• Runtimes
  • Mixing/blending skeleton animations with tk2d

Related Discussions
...

Hi, I wanted to get some clarity on how the mixing of animations is meant to work as I'm not sure if I'm doing something wrong or if i have misunderstood how it should work.

I have a character i built exported from the spine tool and set up in unity using 2dToolkit. It runs fine, but when i switch between animation and try to blend the animations together, the transformation of the bones don't seem to act the way I thought they would.

For example, i have a 'walk' animation on my guy. Then i want him to stop, so i tell the animation to switch to the 'stand' animation. My guy switches, but his leg bones are still stuck in the walk position (although not animating).

This can be seen on the example that comes with spine-tk2d. In that animation, the guy jumps then returns to walking. But if in code you interrupt the jump and try return to the walk animation, his 'torso' bone is left at the last angle used in the 'jump' animation rather than straightening up.

Does anyone know why this happens?

I thought it might be because the 'jump - walk' Animation State Data needs to have a longer duration to mix the two animations, but this doesn't seem to always work.

4 días más tarde

Thanks for the reply, Nate.

Had a good read of the doc to understand it better and eventually worked out that the reason it wasn't blending correctly was to do with setting the keyframes in Spine. On my 'Stand' animation I needed to set keyframes for all the bones at the start of the animation, otherwise the bones had nothing to blend too.