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