Advertisement
MrsMcLead

keyboard

Sep 23rd, 2014
584
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pragma strict
  2.  
  3.  
  4.  
  5. function Update () {
  6.     if(Input.GetKey("right"))
  7.         transform.Translate(.1,0,0);
  8.     if(Input.GetKey("left"))
  9.         transform.Translate(-.1,0,0);
  10.     if(Input.GetKey("up"))
  11.         transform.Translate(0,.1,0);
  12.     if(Input.GetKey("down"))
  13.         transform.Translate(0,-0.1,0);
  14.     if(Input.GetKey("space"))
  15.         rigidbody.useGravity = true;
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement