Every time I play the jumping animation, my character goes down in the y-axis

I am new to unity, I’m still a beginner and I created a character with some simple walk, run, and jumping animations (without using physics, just animating the character jumping). I ran into this issue where my character keeps going down in the y-axis each time i jump.

Before jumping:


After jumping playing the jump animation:

Each time I press the jump button the character will play the jump animation and will decrease the y-axis.
I made sure that my jumping animation starts and ends in the same position. Any idea on how to fix this?
Thanks <3

It’s probably the root motion! Try turning that off on the Animator.

In general, I recommend putting animation (both in 2D and in 3D) as a child of the object that has the Rigidbody and Collider and all that. Then you move the object and have the animation follow. So instead of animating the movement of the jump, you move the rigidbody and have the animation stay still.

Otherwise all your jumps have the exact same length! It’s also very hard to control for the player - think the original 2D Prince of Persia.