Advertisement
D8ms

Untitled

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