- Home /
Question by
doomprodigy · Dec 15, 2010 at 04:24 AM ·
findinactivesetactiverecursively
SetActiveRecursively Question
Hello there another question. I am using SetActiveRecursively to turn off my zombie spawner and turn it back on, one of my first times using SetActiveRecursively.
WHen it starts it does what I want but when I wish to turn it on it isin't
Heres my part of my script to do with SetActivRecursively.
public void Awake() {
GameObject.Find("QuickSpawner1").SetActiveRecursively(false);
GameObject.Find("QuickSpawner2").SetActiveRecursively(false);
}
void Update () {
if (VariableScript.counter == 200)
{
GameObject.Find("QuickSpawner1").SetActiveRecursively(true);
GameObject.Find("QuickSpawner2").SetActiveRecursively(true);
}
Comment
Best Answer
Answer by Eric5h5 · Dec 15, 2010 at 04:47 AM
Find won't find inactive objects. Store the results of Find in variables instead.