|
Hello, I'm having trouble with a script for Mass Spawning to create a swarm of enemies in a side scrolling shooter game. It respawns but makes more than the intended number. Also they are too closely summoned, so I wanted to add a Wait function before continuing the loop but the code didn't seem to work. Does anyone have suggestions?
(comments are locked)
|
|
You want to call the function normally instead of using Invoke if you want to use it as a coroutine, and then use yield before WaitForSeconds. You also need some sort of check to make sure you're not running the coroutine multiple times. e.g.: if (spawning) yield break; Causes an error to appear but remove that and it works. Thanks.
Jul 31 '10 at 06:10 PM
Persona
Oh, sorry, bit of c#there. It was more of a precaution anyway, as it was already checked outside the function.
Jul 31 '10 at 06:31 PM
Mike 3
(comments are locked)
|
