- Home /
How to set movement speed in meters per second to the Standard Assets' ThirdPersonCharacter?
Hello,
I'm looking at the ThirdPersonCharacter in Standard Assets, and I see the walking speed is determined in the following method:
public void OnAnimatorMove()
{
// we implement this function to override the default root motion.
// this allows us to modify the positional speed before it's applied.
if (m_IsGrounded && Time.deltaTime > 0)
{
Vector3 v = (m_Animator.deltaPosition * m_MoveSpeedMultiplier) / Time.deltaTime;
// we preserve the existing y part of the current velocity.
v.y = m_Rigidbody.velocity.y;
m_Rigidbody.velocity = v;
}
}
I don't understand what the Animator.deltaPosition property is, also after reading the documentation that says:
Gets the avatar delta position for the last evaluated frame.
I would like to be able to set the maximum walking speed in meters per second. How would I do it?
Thank you in advance for your help.
Your answer
Follow this Question
Related Questions
Animator.deltaPosition and Animator.deltaRotation always returning zero; 0 Answers
Stop Animation State in Animator from Speeding Up after Playing it a Second Time? 0 Answers
Snapping Child to Root after Animation 2 Answers
Child animator component is moving parent despite unchecking "Apply Root Motion" 1 Answer
Using root motion scripting for specific animations 1 Answer