Advertisement
kadyr

Untitled

Sep 19th, 2021
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. using ExitGames.Client.Photon.StructWrapping;
  2. using UnityEngine;
  3.  
  4. namespace DefaultNamespace
  5. {
  6. public class Shotgun:Gun
  7. {
  8. void Start()
  9. {
  10. damage = 5;
  11. auto = false;
  12. cooldown = 0;
  13. speed = 50;
  14. }
  15.  
  16. protected override void OnShoot()
  17. {
  18. for (int i = 0; i < 15; i++)
  19. {
  20. GameObject bul = Instantiate(bullet);
  21. bul.transform.position = riffleStart.transform.position;
  22. float x = Random.Range(-10, 10);
  23. float y = Random.Range(-15, 15);
  24. bul.transform.rotation = transform.rotation;
  25. bul.GetComponent<Bullet>().setDirection(transform.forward+new Vector3(x/100,y/100,0));
  26. }
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement