From 1deb85510d10dada6fde289f0ec68d8bcde52028 Mon Sep 17 00:00:00 2001 From: Gregory Campbell Date: Sat, 11 Jul 2020 19:04:21 -0400 Subject: [PATCH] Fixed a bug where enemies would spawn instantly if no other enemies were in the game as oppossed to waiting 1-3 seconds --- Assets/Scripts/GMScript.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/GMScript.cs b/Assets/Scripts/GMScript.cs index 91bf3ab..206cd7b 100644 --- a/Assets/Scripts/GMScript.cs +++ b/Assets/Scripts/GMScript.cs @@ -108,9 +108,9 @@ public class GMScript : MonoBehaviour 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); } }