Thanks. Everything looks fine changing animations in the Preview view. I see you have a Test_2: Idle to Idle Combat
animation and it shows jerky motion. Is that where the issue is? You wouldn't normally combine two animations into a single animation, instead you would play the animations at runtime using AnimationState to "crossfade" between them.
What game toolkit are you using? Here's a video explaining how it works with spine-unity:
All runtimes work similarly, so this is worth watching even if you use a different runtime.
You can use Preview to switch between animations, equivalent to calling setAnimation at runtime. Set the mix duration to control how long the mix (crossfade) takes.
Maybe your goal is to create custom transitions rather than have it done automatically? You can do that, though it's more effort than letting the Spine runtime do it for you. In your Test_2: Idle to Idle Combat
animation, it looks like frame 60 is the end of the idle animation and frame 78 is where you pasted your next animation. Your problem is many of your timelines are not keyed in idle but they are keyed in the next animation (and vice versa, probably). Those timelines have the setup pose until frame 78, then they jump into place.
To fix it, make sure the dopesheet is unlocked, press space (or escape) to deselect, then set the timeline position to frame 60 and press ctrl+shift+L
, which is a hotkey for Key Shown
. This sets a key for all timelines shown in the dopesheet. Now your idle animation holds the pose for those problematic timelines until frame 60, then you get a transition from 60 to 78 for all timelines.
Note this will likely be a worse transition than using AnimationState. That is because AnimationState is playing the both animations while the first animation is mixing out. That makes for a smooth transition where everything is moving. After Key Shown
as described, you'll find the animation sort of pauses during the transition. It would take some adjustment to make it look good. With enough work you could probably make it look as good or even better than AnimationState, the main downside to that is doing it for every possible transition between two animations, the number of which quickly becomes unmanageable. Another downside is if you change either animation, your transition animation may need to be redone.
Lastly, once you get your transition like you want. you probably delete all keys before 60 and all keys after 78, then move all the keys so frame 60 becomes from 0. That gives you just the transition animation, then you'd play idle with AnimationState, when you want to change you'd play the transition (with setAnimation
) and then queue the next animation (with addAnimation
).