private void Attack() { if (Input.GetKeyDown(KeyCode.Space) && hasFired == false) { pathFindingGrid.UpdateAllPaths(); gameManager.PlayerActionTaken(); hasFired = true; StartCoroutine(TimeSinceLastShotCounter()); projectile.enabled = true; projectile.GetComponent <Projectile>().Direction = DirectionTurretIsFacing; Instantiate(projectile, transform.position + (Vector3)(DirectionTurretIsFacing / 2), Quaternion.identity, projectiles.transform); } }