- Home /
Question by
zavidiy · Sep 21, 2020 at 10:04 PM ·
scripting problemtimeline
Timeline not play animation when evaluate calling manually from script
I use this code to play timeline
double timer = 0;
while (true) {
yield return null;
// yield return new WaitForEndOfFrame ();
timer += Time.deltaTime * controller.MoveDirection.z;
director.time = timer;
director.Evaluate ();
ApplyRootMotion (root);
}
AnimationTrack not play animation, but root motion working
Comment
Answer by seant_unity · Sep 22, 2020 at 11:49 AM
Animation is updated after Update() and any coroutines run (but before LateUpdate()), so if you have an animator controller assigned it will overwrite the results from timeline. By contrast, using director.Play() will have timeline correctly animate after the animator controller.