• Runtimes
  • [Unity] Question about mixing animations

I'm new to Spine and I've managed to get a grasp on mixing, but I've run into a problem. With two animations, A and B, if it's currently crossfading from A to B and animation A is triggered again before it can fully reach B, it immediately starts animation A without any sort of fading.

Is there anything I can do about that? The crossfade is pretty long with a good chance the player will interrupt it, and it's a very jarring hiccup.

Related Discussions
...
  • تم التحرير

AnimationState only remembers the previous animation. If you are mixing A->B and before the mix is done set A again, it will stop mixing A->B and mix B->A. When it stops mixing A->B it jumps to just B, which is likely not a smooth transition, then mixes B->A.

AnimationState is built on top of Animation, so you could use Animation directly. Maybe it would be best to start with AnimationState and add the functionality you want. It is probably a fair amount of work though. 🙁

Maybe you could find something almost as good. If mixing A->B and then you set A, if the mix is closer to A than to B then mix A->A, otherwise mix B->A. If mixTime / mixDuration < 0.5 then the mix is closer to A. Actually this seems like a decent idea for AnimationState to handle


done!
https://github.com/EsotericSoftware/spi ... 7b3835d973

Beautiful, that's exactly what I needed, works perfectly. Thanks a lot Nate! 🙂