Hello, I properly sound really stupid but, I’ve been looking everywhere for answers and I’m still very confused, I’m new to animating in unity and I used Adobe Fuse/Mixamo to create a simple player that can walk around with the normal “WASD” keys. I used a blend tree to blend all the different walking animations together depending on where the character is going:
I was just wondering how someone could play a state animation too. The blend Tree in the picture handles the walking animations of the character beautifully, I want to add a jump animation to it but once the game starts it plays through the Blend tree non-stop and I can’t play anything else on top. Whats the workaround?
Make sure the Jump state’s Has Exit Time checkbox is ticked. This lets the state run to completion (i.e., finish playing the jump) before transitioning back.
Make sure Blend Tree’s Has Exit Time is unticked. This allows Mecanim to transition to Jump immediately instead of waiting for the Blend Tree’s animation to finish a loop.
Check the transition from Blend Tree to Jump. Let’s say you’ve defined a trigger parameter named “jump” and set the transition to occur when “jump” is true. In your script’s Update() method, check for, say, the space bar and set the trigger true:
void Update() {
if (Input.GetKeyDown(KeyCode.Space)) {
GetComponent<Animator>().SetTrigger("jump");
}
}