- Home /
Mecanim RigidBody JUMP
Hi
I want to make a character jump, with animation. This is the code:
........
private Animator anim;
........
if (Input.GetButtonDown ("Vertical"))
{
if (Input.GetAxis("Vertical")>0){
rigidbody.AddForce(jumpVelocity, ForceMode.VelocityChange);
anim.SetBool("Jumping",true);
}
else{
anim.SetBool ("Duck", true);
}
}
The "Duck" parameter works 100% of the times and the "Jump" function works 100% as a rigidbody with Force, but only 70-80% with the "Jump" animation.
The transition setting in Animator are the same for Duck and Jump. Even if I remove the "Add Force" line, the jump animation still works 70-80% of the times the button is pressed.
I'm using unity 4.3.x.
Any ideea of what I'm doing wrong??
Thank you
Comment