How do i enable/disable an object and its child objects?
May 02, 2012 at 10:08 PM
Are you using Unity 3 or Unity 4?
for Unity 3 :
gameObject.SetActiveRecursively( true );
For Unity 4 : http://answers.unity3d.com/questions/353475/setactiverecursively-is-now-obsolete-in-unity-40.html
You can call `SetActiveRecursively(false)` on a GameObject to disable the object, its components, and any children.
May 02, 2012 at 10:18 PM
May 02, 2012 at 10:19 PM
And what if you want to deactivate the child WITHOUT deactivating the parent? What then?
Create an uncle between parent and children, kill the uncle and save the parent :)
Jan 06, 2013 at 07:39 AM
Jan 06, 2013 at 07:27 AM
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
Once you sign in you will be able to subscribe for any updates here
Answers and Comments
The best place to ask and answer questions about development with Unity.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
To help users post good questions and use the site effectively we have posted a tutorial video. Please check it out.
asked: May 02, 2012 at 10:08 PM
Seen: 6109 times
Last Updated: Jan 06, 2013 at 07:39 AM
Getting an objects Children
enable/disable private gameObject
Disable an child object
How To Deactivate A Parent (And Its Children)?
Enable/Disable GameObject Button script
enable disable objects when objects collides with other object
enable disable object script error?
How to enable children of child game object?
C# Find component InChildren
Disabling audio Listener on the child of a newly instantiated gameObject?