|
I have 3 prefabs named "blackout" being instantiated in the position of other 3 gameObjects I positioned and rotated myself in the editor. This works fine. However, after the 3 blackouts are instantiated, I need to "set active to false" (disactivate) each one of them in an interval of 2 seconds between each one - starting from the first blackout - instantiated in the position of blackoutCollection[0] - until the last and third blackout - positioned in blackoutCollection[2]. How can I do this? I'm failing to access the blackout gameObjects. blackoutCollection[i] are only empty gameObjects used to place the blackout prefabs where I want.
I tryied using
(comments are locked)
|
|
you can each instantiated prefabs set child your 3 position gameobject (blackoutCollection[i]) try follow. not checked for (i=0; i<=2; i++) {
and instead blackoutCollection[1].gameObject.active = false; call blackoutCollection[1].gameObject.SetActiveRecursively(false); Thank you! This worked perfectly. The only thing that was missing was the "transform.parent": instObj.transform.parent = blackoutCollection[i].transform;
Jan 24 '11 at 06:53 PM
Al Anselmo
(comments are locked)
|
