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. Check out our FAQ for more information.
We're looking for more community managers.
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: 5026 times
Last Updated: Jan 06, 2013 at 07:39 AM
C# Find component InChildren
Disabling audio Listener on the child of a newly instantiated gameObject?
Disabling/Enabling components in children of children?
Getting an objects Children
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?
This should be simple : Input Button Question