Jump animation continuing after initial jump (2D)

Hello! I am a brand new Unity user, and i’m having issues with a jump animation. I’m making a 2D platformer, and i’ve made my jump and its animation work. There’s just one issue though, the jump animation keeps looping after the initial jump. I want to make a statement that pretty much says this:
if rigidbody.velocity.y = 0.001f
{
animator.SetBool(“JumpAnimation”, false);
}
I’ve tried many different things, but I can’t get the animation to stop looping. Some help would be great! I’ll also attach the code i’ve already made.

7103872–846931–Actions.cs (968 Bytes)

Hey,

Sorry, I’m not a coder, so I’m not sure if there are issues with your code, but something that could be preventing the jump loop from ending is your animation transitions. An easy way to test this is to run your code and check if your animator bool actually changed in the animator. If it did, your code isn’t the issue.

So make sure that your transition from the jump state has KoopaJump = false.

Sorry if that wasn’t the issue. I can’t really help when it comes to code, but there are some really good tutorials for exactly what you’re trying to accomplish.

This is a Brackey’s 2D character controller tutorial:

And this is his follow-up tutorial where he adds 2D animation to the controller:

Hopefully someone else will drop by with a better answer, but until then, good luck!