Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class Shotgun:Gun
- {
- void Start()
- {
- damage = 5;
- auto = false;
- coolDown = 0f;
- speed = 0.1f;
- }
- protected override void OnShoot()
- {
- for (int i = 0; i < 10; i++)
- {
- GameObject buf = Instantiate(bullet);
- buf.transform.position = riffleStart.transform.position;
- float x = Random.Range(-30, 30);
- float y = Random.Range(-10, 10);
- buf.transform.rotation = transform.rotation;
- buf.GetComponent<Bullet>().setDirection(transform.forward + new Vector3(x / 500, y / 500, 0));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement