// Update is called once per frame void Update() { Debug.Log("incrementing"); Debug.Log(spawnTimer); spawnTimer--; if (spawnTimer <= 0) { Debug.Log("spawning"); spawnTimer = 100f; GameObject enemy = Instantiate(enemyObj, gameObject.transform); enemy.transform.position = transform.position; EnemyScript enemyScript = enemy.GetComponent <EnemyScript>(); enemyScript.Alert(); } }