Is there another way of phrasing this?


Take a look at this:

if (gameObject.Find("SphereBall(Clone)") == false && gameObject.Find("fireBall(Clone)") == false && gameObject.Find("tronBall(Clone)") == false)

So basically that 'if statement' checks if those GameObjects are still active in the world space. I have 6 balls spawning randomly each time this statement is proven true. Basically, when the balls are all gone, it spawns 6 more. Problem is, apparently according to my tests, this statement doesn't work in the browser form of my game. It does work within the editor, but no where else. Does anyone have a smarter version of this statement? I would greatly appreciate help on this subject.

thanks, -Craze

You should use uppercase for the function GameObject.Find.

Quote from the reference:

For performance reasons it is recommended to not use this function every frame Instead cache the result in a member variable at startup or use GameObject.FindWithTag.

So it would be better to set a GameObject.tag to your objects and use GameObject.FindWithTag in your if statement.