Basically, my problem is that I’m using variable “i” to flip through an array of spawn points. When i becomes greater than the amount of spawn points available, “i” obviously leaves the range of the spawn point array. My solution is to simply reset “i” inside the scope of the for loop, but this doesn’t seem to solve my problem. What’s going on?
function spawnWave()
{
if(waveActive)
{
for (var i=0; i<=waveNumber; i++)
{
if (i>8)
{
i = 0;
print(i);
}
Instantiate(enemy1, Vector3(spawnArray<em>.transform.position.x, spawnArray_.transform.position.y, spawnArray*.transform.position.z), Quaternion.identity);*_</em>
* //something to delay spawning for more than six*
* }*
* waveActive = false;*
* needSpawn = false;*
* }*
* else*
* {*
* yield WaitForSeconds(1);*
* waveActive = true;*
* }*
}