IEnumerator Fire() { canFire = false; yield return(new WaitForSeconds(fireRate)); if (!target) { canFire = true; yield break; } this.GetComponent <AudioSource>().Play(); GameObject newAmmo = GameObject.Instantiate(myAmmo); Ammo nA = newAmmo.GetComponent <Ammo>(); newAmmo.transform.position = ammoOriginPoint.transform.position; newAmmo.transform.rotation = turretTopPart.transform.rotation; nA.SetSpeed(nA.GetSpeed() + extraAmmoSpeed); nA.SetDamage(nA.GetDamage() + (int)extraAmmoSpeed); canFire = true; }