I have a small problem I want to fix. I am using the animator to play a jump animation which I have got working.
But when he lands early on something I want the jump animation to stop. ATM I have set the exit time to stop the animation which works fine if its a normal jump. But when you jump up to something and he lands early I want to exit out of the jumping animation early… How can I do this ?
You could just try to detect if the player landed on something and stop the animation via Unity - Scripting API: Animation.Stop
Depends on your setup how you would like to detect if the player is standing on something, but assuming that you’re already sing something like that to detect where the player should be able to jump you should be able to just re-use that part of the code. Basically something like :
if (animation.IsPlaying("jump") && player.isStandingOnSomething)
animation.Stop("jump");
OK solved it
I just played the idle animation like so when he landed.
animator.Play(“Idle”);
Thanks for the help