Animation + Scripting question

I have an animation for jump and an animation for double jump. When the user is in the air and they press spacebar again they can double jump(flip in the air). So upon pressing spacebar I set an animation parameter of doubleJump = true, triggering the transition to the double jump animation.

Now here’s my problem: The roll animation is setup to NOT loop and end once it’s complete. But when it ends it transitions back to the jump animation which then detects that the doubleJump==true & transitions back to the roll. SO it ends up just rolling over and over until the character hits the ground. Is there a way to trigger animation state changes upon animations completing? Am I going about this all wrong?

I assume the doubleJump animation parameter is a bool? Try using a trigger animation parameter instead, which triggers only once, or reset the doubleJump bool before the animation ends.

Thermal thanks for your response! I see. I googled to see what a Trigger animation parameter was and came across this post which describes both options with code:

Also explained in the documentation: