using System.Collections; using System.Collections.Generic; using UnityEngine; public class Player : MonoBehaviour { [SerializeField] private float _speed = 3.5f; void Start() { } // Update is called once per frame void Update() { Movement(); } void Movement() { float horizontalInput = Input.GetAxis("Horizontal"); float verticalInput = Input.GetAxis("Vertical"); Vector3 directions = new Vector3(horizontalInput, 0, verticalInput); transform.Translate(directions * _speed * Time.deltaTime); } }