when i stop pressing a key the player keep going for some more frames
here is my code
public class Mover : MonoBehaviour
{
private const string HORIZONTAL_AXIS = "Horizontal";
private const string VERTICAL_AXIS = "Vertical";
[SerializeField] float speed = 1f;
private void Update() {
float inputX = Input.GetAxis(HORIZONTAL_AXIS);
float inputY = Input.GetAxis(VERTICAL_AXIS);
Vector3 inputMoviment = new Vector3(inputX, 0, inputY);
inputMoviment = inputMoviment.normalized;
float movimentSpeed = Time.deltaTime * speed;
transform.Translate(inputMoviment.x * movimentSpeed, 0, inputMoviment.z * movimentSpeed);
Debug.Log(inputMoviment + " " + inputX+ " " + inputY);
}
}
I don’t think there is a problem on it
When stop pressing a key, the value don’t go immediately to 0, it passes thought every thing in batween as if it was analogic