• Runtimes
  • How can i mix an animation from empty animation?

  • Изменено
Related Discussions
...

Some animation like aim animation should make the target bone move slowly to a target location by time, not teleport to the location. It can be achieved by setting mix time over animations, but i guess there is no option for setting mix time between an animation and empty animation. (mix from empty animation to some other)

I think this is a quite easy question, But i can't see any proper approach to do this.
it will be great if you share any solution or example page for this.

Sure, see AnimationState setEmptyAnimation, paragraph starting "Mixing in is done by". Eg:

state.setEmptyAnimation(0, 0);
entry = state.addAnimation(0, "aim", true, 0);
entry.mixDuration = 2; // Go from empty to aim over 2 seconds.

Ah great! Now i see how to do it, Thank you for the help!