• Editor
  • [Feature Request] How spine handles animation mixing

I'm having a bit of an issue with mixing animations in Spine (Unity). I have an Idle animation and a Running animation. I've set the transitions between each animation to 0.1 seconds. It all looks great if you get all the way to running before you let go of the run key / thumbstick. However, if you tap the run key and release, it jumps all the way to the Running animation and transitions back to Idle. This looks wrong - the desired effect would be to transition from whatever in-between pose you are currently in to Idle. I'd request that this be the built-in behavior, or is there a way I can modify the code to achieve this myself?

Related Discussions
...
  • Modifié

Hi Nate, thanks for your reply. Ok I've tried the updated version, but I can't see a massive difference - it's still jumping frames rather than transitioning from whatever the current state of the skeleton happens to be.

Yes, the jump should be smaller though. AnimationState only keeps the previous and current animation. To do what you want it would need to keep n number of animations. Eg if during the mix of A->B you set C, it would need to keep the state for A, B, and C. If during that mix you set D, you'd need to keep the state of A, B, C, and D. Currently it only keeps the state for A or B (whichever the A->B mix that is being interrupted was closest to) and C. This isn't perfect but mixes are usually pretty short. The complexity of handling any number of previous animations is a lot higher. You could write something to do this, probably based on AnimationState.