- Home /
Smooth 3D Dodge Roll Animation
My actual problem is that my "Roll" forward is so fast that the animation ends only when the rigidbody has been standing for a long time already. So it looks a bit weird. The goal is that the animation plays exactly from start until end of the movement/dash/roll. But actually i am pushed forward and the animation starts to late and ends to late. I use rigidbody.AddForce but when i add less speed, i also have less distance. What i want to achieve is the possibility to make the Dodge Roll for a specific distance (e.g. 10m) in a variable time. So that i can try different settings (e.g. rigidbody needs 2sec. for 10m or rigidbody needs 4 sec. for 10m). That way i can adjust the animation exactly to my forward movement.
The animation is from Mixamo and i dont use root motion. I also played with the ForceModes but had no success. Also tired velocity but the result was pretty the same as with AddForce.
private void UpdateDash()
{
if (Input.GetButtonDown("Dash"))
{
rigidbodyPlayer.AddForce(transform.forward * DashDistance, ForceMode.Force);
animator.SetTrigger("isDashing");
}
}
Hopefully there is someone who can help me out. And yeah i am a sort of beginner ;D