2D Animation too fast when testing game. Do Not Know how to fix, please help.

private void FixedUpdate()
    {
        if (Input.GetKey("d"))
        {
            rb2d.velocity = new Vector2(5, rb2d.velocity.y);
            animator.Play("Running");       
        }

The speed of the animation is fine when I look at it in the animation window and when I play it. But when I input the “d” key which starts the animation, the animation plays super fast and I do not know how to slow it down.

Edit: It seems like whenever I click and hold down “d” to move, the animation just keeps repeating the first frame. I do not know how to stop this.

It could be that you’re not letting the animation finish. It just starts over and over again when you hold it down.

To fix your second problem, instead of using “Input.GetKey()” you should use “Input.GetKeyDown()”
This will change it from being called every frame that you are pressing the key, to only the frame where you start pressing it.

1 Like