- Home /
Question by
Nodgez · Sep 29, 2021 at 04:04 PM ·
animationtimelineroot motion
How to handle Scripted root motion with timeline animation track?
Hi,
I have a script that manages how the animator moves my component with OnAnimatorMove() The characters that have this script need to be part of a Timeline sequence.
For some reason handling the root motion myself overrides the position offset generated by the timeline. Does anyone know what values the timeline is altering and if I can just apply the timeline values in OnAnimatorMove()?
void OnAnimatorMove()
{
if (TimelinePlaying)
{
anim.ApplyBuiltinRootMotion();
return;
}
agent.velocity = anim.deltaPosition / Time.deltaTime;
transform.parent.rotation = anim.rootRotation;
}
Comment
Your answer
Follow this Question
Related Questions
How to loop root motion in timeline? 3 Answers
Root motion with attack animation 0 Answers
Timeline/custom playable How to allow in-scene animation? 0 Answers