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?
asked Jul 31 '10 at 02:08 PM
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.:
answered Jul 31 '10 at 02:18 PM