Advertisement
Guest User

Untitled

a guest
Mar 20th, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Bullet : MonoBehaviour {
  6.  
  7.  
  8. public GameObject origin;
  9. public Rigidbody me;
  10.  
  11. public float bulletSpeed = 1000f;
  12.  
  13. void Start ()
  14. {
  15.  
  16. Vector3 dir = new Vector3 (origin.transform.localRotation.x, origin.transform.localRotation.y, origin.transform.localRotation.z);
  17.  
  18. me.AddForce (dir * bulletSpeed);
  19.  
  20.  
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement