Jump cancelling with sprint

Hello, I need my Sprint key to stop the jump early. E.g. if I pressed space and immediately sprinted, the jump animation should stop asap and go into the sprinting animation. How would I do this?


This is something we call interupt. There are many ways to do it, developers needs to come out with a consistent method which can also be applied to various actors.

Here’s and idea:
Whenever your sprint is pressed, do the check if your character is in air or not (jump or not). If it is, lerp the translation of z straight to ground and increase the movement speed straight away. Observe the z translation of the character to get the values.

Alternate idea is to utilize the anim montage root motion. If you want to do this, you will need to set the movement mode to flying as the root motion default settings only care for x and y axis.