x


enable/disable child objects?

How do i enable/disable an object and its child objects?

more ▼

asked May 02 '12 at 10:08 PM

JBoy gravatar image

JBoy
152 34 45 48

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

Jan 06 '13 at 07:39 AM alucardj
(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

You can call SetActiveRecursively(false) on a GameObject to disable the object, its components, and any children.

more ▼

answered May 02 '12 at 10:18 PM

rutter gravatar image

rutter
9k 4 16

And what if you want to deactivate the child WITHOUT deactivating the parent? What then?

Sep 03 '12 at 12:52 PM Dubious Drewski
(comments are locked)
10|3000 characters needed characters left

Create an uncle between parent and children, kill the uncle and save the parent :)

more ▼

answered Jan 06 '13 at 07:39 AM

tienphan gravatar image

tienphan
16

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1556
x591
x312
x269
x209

asked: May 02 '12 at 10:08 PM

Seen: 4106 times

Last Updated: Jan 06 '13 at 07:39 AM