I’m having difficulties using the Animator API to precisely recreate a particular crossfaded state between two animations.
Specifically, I want to use CrossFade (or CrossFadeInFixedTime) to immediately set the animator to a state partially blended into the second state.
I’m aware that I can use the fixedTime parameter in Animator.PlayInFixedTime to set the animation to a particular time.
animator.Play("State1", 0);
// an unknown number of animator.Update calls, over the duration of someTime
// Attempting to recreate the exact same animation state
animator.PlayInFixedTime("State1", 0, someTime); // This appears to recreate the same state as if I iteratively called Update
However, I’m not having luck doing the same with CrossFade / CrossFadeInFixedTime.
animator.Play("State1", 0, 0);
animator.CrossFadeInFixedTime("State2", crossFadeDuration, 0);
// an unknown number of animator.Update calls, over the duration of someTime
// Attempting to recreate the exact same animation state
animator.Play("State1", 0, 0);
animator.CrossFadeInFixedTime("State2", crossFadeDuration, 0, someTime); // This does not recreate the same state as if I iteratively called Update.
// The crossfade would now begin crossfading for the full duration; I instead want the animator to be someTime into the crossfade
I’ve tried several combinations of using Animator.Update(deltaTime) to skip the animator into the desired partially-crossfaded state:
animator.Play("State1", 0, 0);
animator.CrossFadeInFixedTime("State2", crossFadeDuration, 0, 0);
animator.Update(someTime);
However, this doesn’t seem to do what I want it to, either; the animator appears to skip the crossfade entirely.
Am I misunderstanding how to use the Play/CrossFade/Update calls? It seems strange that I can’t use some combination of them to recreate a particular crossblended state.