eastbayeff

Untitled

Jun 29th, 2021
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.34 KB | None | 0 0
  1.     void Fire()
  2.     {
  3.         var shot = Instantiate(shotPrefab, firePoint.position, firePoint.rotation);
  4.        
  5.         var rb = shot.GetComponent<Rigidbody>();
  6.         rb.AddForce(shot.transform.forward * _shotPower, ForceMode.Impulse);
  7.        
  8.         shot.GetComponent<Shot>().PlayFireSound();
  9.  
  10.         _player.CurrentAmmo--;
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment