Advertisement
MrsMcLead

Untitled

Oct 8th, 2014
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pragma strict
  2.  
  3. function Update () {
  4.  var horizontal : float = Input.GetAxis("Horizontal");
  5.  var vertical : float = Input.GetAxis("Vertical");
  6.  var speed : float = 3;
  7.  
  8.  rigidbody.AddForce(Vector3(horizontal*speed,0,vertical*speed));
  9.  
  10. }
  11.  
  12. function onTriggerEnter(other: Collider)
  13. {
  14.     if(gameObject.tag == "Collectable")
  15.     Destroy(other.gameObject);
  16.    
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement