- Home /
How to switch between procedural animation to Mecanim / Animator animations
Hi! I'm doing a real time lipsync script by animating bones procedurally while the voice audio is playing. So far everything OK. The problem comes when audio finishes, I want the bones to move according to what the current animation clip indicates.
What I see is that, if I override a bone transform in LateUptate() once, then the bone won't restore its transform values according to what the current animation clip indicates anymore.
Let me show you the very basic code example:
public Transform boneToOverride; // It has assigned the desired bone
public bool overrideAnimation; // it should let me switch between procedural and clip animation
void LateUpdate() {
if (overrideAnimation) {
boneToOverride.position = new Vector(some, procedural, value);
}
}
I read that the legacy Animation component, applies clip animations after Update() and before LateUpdate(). It seems to me that it doesn't work like this for the Animator component.
I would appreciate if you could help me on this.
Thank you!
Your answer
Follow this Question
Related Questions
What is the proper way to wait for an Animator Controller to update? 1 Answer
C# Help with setting up jump animation 0 Answers
Problem adding individual clip speed 2 Answers
Animation driven NavMeshAgent with Speed, AngularSpeed and Direction as parameters. 1 Answer
Animation in edit mode with Mecanim 0 Answers