Code (CSharp): void Update () { if (!GameObject.Find ("Space Ship Object")) { Invoke ("reload", 2.0f); } } void reload() { Application.LoadLevel(Application.loadedLevel); } When the Space Ship Object gets destroyed, it doesn't activate (or invoke) the reload function, while it does if I'm not negating the 'if' statement. Please help.
hate to say it, but this is completely the wrong way to go about this. You're checking for something to have been destroyed every frame, you're using find in all of those checks (which is a poor performance method). And if it did work for 2 seconds there are going to be invoke calls stacking up, which admittedly isn't a huge issue since the loadlevel will kill all those after the first, but still. Far better to have the thing being destroyed drive this rather than checking every frame. Check out the "OnDestroy" function.