Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import UnityEngine
- class MovementScript (MonoBehaviour):
- public float moveSpeed = 50;
- def FixedUpdate() {
- MaybeMove();
- }
- def MaybeMove(){
- Vector3 moveDir = (Input.GetAxisRaw("Horizontal") * Vector3.right) + (Input.GetAxisRaw("Vertical") * Vector3.forward);
- transform.Translate(moveDir.normalized * realSpeed * Time.deltaTime);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement