Guest User

Bullet.js

a guest
Sep 28th, 2015
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pragma strict
  2.  
  3. var velocity: float;
  4. var timeToLeave: float;
  5.  
  6. function Start () {
  7.  
  8. }
  9.  
  10. function Update () {
  11.  
  12. timeToLeave += Time.deltaTime;
  13.  
  14. if(timeToLeave >= 4){
  15.  
  16.     Destroy(gameObject);
  17.  
  18. }
  19.  
  20. transform.Translate(Vector3.forward*velocity);
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment