- Home /
Problem is not reproducible or outdated, it was a bug with the editor, I restarted and everything fixed itself, haven't had the problem again since then
How do I fix this stupid jump animation not transitioning
I have a jump animation, which plays in up frame if the player is moving up, and a down frame if the player is moving down. this works fine. I transition into the jump animation by setting a bool "Jump" to true, and am trying to transition out by setting it to false. for some reason this doesn't work. Here's the code:
if (groundCheck != null)
{
IsGrounded = true;
animator.SetBool("Jump", false);
}
else if (groundCheck == null)
{
IsGrounded = false;
animator.SetBool("Jump", true);
}
that's it. I have no clue why this doesn't work. I even made the IsGrounded bool public to check on it, and it works fine, detecting when I'm in air and detecting when i'm on the ground. PLEASE HELP
What is the groundCheck
var and please show the animator too.
Answer by Aeneas_Ferguson · Jan 18, 2021 at 12:07 AM
@falconstrike209 Does your animator have a transition to another animation/state for the bool Jump,false? It could be helpful to watch your animator run during the game to see if the transition is happening to fast or not at all.
It has a transition with the bool, for some reason setting the bool to true or false in the transition conditions in the animator controller wasn't an option for me.
Ah, that might be the problem. If can't still can't set if after restarting Unity, then maybe file a bug report. With out the bool in the animator window, you can't set anying true/false.
yeah, looking at the animator while running the game, even tho it transitions into the jump animation the bool doesn't get checked
Could you upload a short video of the animator when your game is running? I might be able to see the issue.
"Any State is a special state which is always present. It exists for the situation where you want to go to a specific state regardless of which state you are currently in."- Unity manual. $$anonymous$$aybe don't try to transition to the jump animation with the "Any State". $$anonymous$$ake a bool that connects to "Jump" from "p2_Run" that is true, so they player can jump when running, and a bool that connects to "p2_Run" from "Jump" to set the bool jump false. If you only want the player to jump when not running, do the same thing but make the transition from "p2_idle" to "jump" (to set the jump bool true) and a transition from "Jump" to "p2_idle" to set the jumping bool false.
Follow this Question
Related Questions
Can I make animations snap to a frame? 1 Answer
Forward jumping 1 Answer
Need help with tool animations!! 1 Answer
I need help with an animation in unity 1 Answer
How to play one animation single time and then loop second animation? 0 Answers