void Fire() { Projectile aProjectile; MuzzleFlash muzzleFlash = GetComponent <MuzzleFlash>(); nextShotTime = Time.time + fireRate / 1000; aProjectile = Instantiate(projectile, muzzle.position, muzzle.rotation); aProjectile.SetSpeed(muzzleVelocity); Instantiate(shell, ejector.position, ejector.rotation); muzzleFlash.Animate(); AnimateRecoil(); }