Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Bullet : Transform;
- var Spawn : Transform;
- function Update ()
- {
- if(Input.GetButtonDown("Fire1"))
- {
- Shot();
- }
- }
- function Shot()
- {
- var pel = Instantiate(Bullet, Spawn.position, Spawn.rotation);
- pel.rigidbody.AddForce(transform.forward * 8000);
- }
Advertisement
Add Comment
Please, Sign In to add comment