Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class PlayerMovement : MonoBehaviour {
- public float speed = 0.02f;
- // Update is called once per frame
- void Update() {
- float x = Input.GetAxis("Horizontal");
- float y = Input.GetAxis("Vertical");
- Vector3 move = new Vector3(x, y, 0);
- move.Normalize();
- transform.position = transform.position + move * speed;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement