Advertisement
MrsMcLead

keyboardMovement

Oct 6th, 2014
643
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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement