Advertisement
aandnota

bullet.js

Feb 22nd, 2012
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var speed : float = 10.0;
  2.  
  3. function Update () {
  4.     transform.position += speed * Time.deltaTime;
  5. }
  6. function OnTriggerEnter(other:Collider){
  7.     if(other.gameObject.tag == "Asteroid"){
  8.         Debug.Log("hit");
  9.         Destroy(other.gameObject);
  10.         } else if (other.gameObject.tag == "cube"){
  11.         Destroy(this.gameObject);
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement