Advertisement
D8ms

Untitled

Feb 3rd, 2013
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import UnityEngine
  2.  
  3. class MovementScript (MonoBehaviour):
  4.     public float moveSpeed = 50;
  5.        
  6.     def FixedUpdate() {
  7.         MaybeMove();
  8.     }
  9.  
  10.     def MaybeMove(){
  11.         Vector3 moveDir = (Input.GetAxisRaw("Horizontal") * Vector3.right) + (Input.GetAxisRaw("Vertical") * Vector3.forward);
  12.         transform.Translate(moveDir.normalized * realSpeed * Time.deltaTime);
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement