I have an Idle, Walk and Jump animation. Walking and idling does work but when I jump it goes to the jump animation but for too long. When my player get back on the ground again it stays in the jump animation for 1 more second. Screens: Here ^^ it waits 1 second and then normal again:
Duration isn't gonna work because when I jump to a higher ground it will still be wrong. Disabling exit time doesnt work.
How are you currently controlling what animation plays? Are you detecting when the player lands and swapping back to a different animation?
You could make sure all transitions in the animator have Exit Time disabled, Then in your script, detect when the player lands and set the jump to false by something like Code (CSharp): animator.SetBool("Jump",falsE);
Code (csharp): void Jump() { if (Input.GetKeyDown (KeyCode.Space)) { if (grounded) { rigid.AddForce (Vector2.up * jumpPower); anim.SetBool ("Jump", true); grounded = false; } } } void OnCollisionEnter2D(Collision2D collider) { if(collider.gameObject.CompareTag("Ground")) { anim.SetBool ("Jump", false); grounded = true; } }
I think it maybe let the animation finish before pass to the next one... It's some parameter in the animation for sure