Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var speed : float = 10.0;
- function Update () {
- transform.position += speed * Time.deltaTime;
- }
- function OnTriggerEnter(other:Collider){
- if(other.gameObject.tag == "Asteroid"){
- Debug.Log("hit");
- Destroy(other.gameObject);
- } else if (other.gameObject.tag == "cube"){
- Destroy(this.gameObject);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement