How do i enable/disable an object and its child objects?
May 02 '12 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 '12 at 10:18 PM
May 02 '12 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 '13 at 07:39 AM
Jan 06 '13 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.
To help users post good questions and use the site effectively we have posted a tutorial video. Please check it out.
asked: May 02 '12 at 10:08 PM
Seen: 4106 times
Last Updated: Jan 06 '13 at 07:39 AM
Disabling audio Listener on the child of a newly instantiated gameObject?
Disabling/Enabling components in children of children?
Getting an objects Children
How To Deactivate A Parent (And Its Children)?
Disable an child object
Enable/Disable GameObject Button script
C# Find component InChildren
enable disable objects when objects collides with other object
enable disable object script error?
Enabling and Disabling Shurken Particles