void FireBullet() { GameObject newBullet = (GameObject)Instantiate(bullet, bulletSpawnPos.position, Quaternion.identity); BulletScript BS = newBullet.GetComponent <BulletScript> (); BS.damage = attackDamage; BS.SetAudioPitch(GetPitch()); Invoke("FireBullet", fireRate); }