Answer the question
In order to leave comments, you need to log in
Why is the timer not working?
What's wrong?
IEnumerator SpawnMobs()
{
Debug.Log(ThisZombieSpawn);
Debug.Log(CountZombieSpawn);
if (ThisZombieSpawn < CountZombieSpawn)
{
Instantiate(ZombieType[NomberZombie], StartPos.position, Quaternion.identity);
yield return new WaitForSeconds(4); // доходит до сюда и дальше тишина...
ThisZombieSpawn++;
SpawnMobs();
}
}
Answer the question
In order to leave comments, you need to log in
In the start method or wherever you need it, you most likely did not write StartCoroutine(SpawnMobs())
Should it be a looped coroutine?
At the end, do you call the SpawnMobs method, or did you mistakenly decide to start the coroutine again?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question