Closed kodra-dev closed 8 months ago
Animancer is updated by Unity during the regular animation update so its should generally follow the diagram.
Is it a newly instantiated character? It could be that Unity isn't updating it on that frame because it was only added to the end of the update list. In that case, calling Evaluate in the coroutine after Play is likely the correct solution.
But if happens with existing game objects too. It happens in a live project... but perhaps I could try to make a reproducible sample project when I have time for it
I tried a few things but wasn't able to replicate what you've described, so please do send me a minimal reproduction project if you can.
From this flow chart, I assume animation evaluation happens between
yield new WaitForSeconds
and rendering. Therefore, starting playing a new clip (_animancerComponent.Play(clip)
) from a Coroutine is safe.However, I found if I start playing a clip from a Coroutine owned by another game object, it sometimes results in rendering unevaluated state from one frame, causing the animation flickers.
If I add:
The problem is completely gone. Which implies animancer is not always evaluated between Coroutine and rendering? What's the rule of the timing of evaluation? And is there a better solution than calling
Evaluate()
manually?