Fixed a bug where enemies would spawn instantly if no other enemies were in the game as oppossed to waiting 1-3 seconds
This commit is contained in:
@@ -108,9 +108,9 @@ public class GMScript : MonoBehaviour
|
|||||||
enemyTime = 0.0f;
|
enemyTime = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(GameObject.FindWithTag("Enemy") == null)
|
if(GameObject.FindWithTag("Enemy") == null && enemySpawnTime - enemyTime > 3.0f)
|
||||||
{
|
{
|
||||||
enemySpawnTime = Random.Range(1.0f, 3.0f);
|
enemySpawnTime = enemyTime + Random.Range(1.0f, 3.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user