x


enable/disable child objects?

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

more ▼

asked May 02, 2012 at 10:08 PM

JBoy gravatar image

JBoy
197 95 92 93

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, 2013 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, 2012 at 10:18 PM

rutter gravatar image

rutter
14.8k 8 29

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

Sep 03, 2012 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, 2013 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:

x1707
x642
x334
x288
x221

asked: May 02, 2012 at 10:08 PM

Seen: 5026 times

Last Updated: Jan 06, 2013 at 07:39 AM