Why doesn't Input.GetAxis("Horizontal") > 0 stop immediately?

I’m having a hard time to understand why after I stop pressing right or left in order to move my sprite, when I release any arrow button it keeps few frames moving when I meant to stop them right away.

Any ideas?

he is the vanilla moving code:

// Update is called once per frame
void Update()
{   

    if (Input.GetAxis("Horizontal") > 0)
    {
        transform.Translate(Vector3.right * speed * Time.deltaTime);
        transform.eulerAngles = new Vector2(0, 0);
    }
    if (Input.GetAxis("Horizontal") < 0)
    {
        transform.Translate(Vector3.right * speed * Time.deltaTime);
        transform.eulerAngles = new Vector2(0, 180);
    }
    if (Input.GetAxis("Vertical") > 0)
    {
        transform.Translate(Vector3.up * speed * Time.deltaTime);
    }
    else if (Input.GetAxis("Vertical") < 0)
    {
        transform.Translate(Vector3.down * speed * Time.deltaTime);
    }
    
    
}

That is because Input.GetAxisRaw exists :slight_smile:

Input.GetAxis doesn’t immediately return 0 when released or 1 when pressed.