HATEBIN
>
using UnityEngine; using UnityEngine.UI; public class TestMovement : MonoBehaviour { [SerializeField] private Text _text = null; private float _speed = 10f; private void Update() { var x = Input.GetAxis("Horizontal"); var y = Input.GetAxis("Vertical"); Move(new Vector2(x, y)); } private void Move(Vector2 direction) { if (direction == Vector2.zero) { _text.text = "No input"; return; } _text.text = direction.ToString(); transform.position += (Vector3)direction * _speed * Time.deltaTime; } }