FrazerBee

Hi. Apologies if this has been asked before but I couldn't find it!

We would like to use animation blending in our humanoid based game, but as we use the head bone scale to turn/flip the characters head, this results in the head 'squashing' during interpolation (i.e. from -1, through 0, up to +1).

In hand made animations we simply remove interpolation to keep the head 'solid'.

Is there a way of excluding certain bones from the runtime animation blending?

Thanks for any help!
FrazerBee
  • Posts: 3

Harald

FrazerBee wrote:Is there a way of excluding certain bones from the runtime animation blending?
There is no bone mask support for spine-unity, sorry! The normal solution for anything that requires masking of certain bones would be to split one animation in two in the Spine Editor. So e.g. instead of having a upper and lower body run animation and play it with all upper-body movement masked out, you could duplicate the run animation to run-upper and run-lower with the respective to-be-masked bone keys removed.

In your case you could then customize transition durations of all head-turn animations on your head-track to 0 while having normal smooth transitions on the remaining animation tracks.
User avatar
Harald

Harri
  • Posts: 3575

FrazerBee

Thanks Harald!

Unfortunately that solution sounds like it would add a lot of complexity to our pipeline for only a modest benefit.

Can you suggest any other solutions for 2D character head 'turning' which would play nicely with animation blending?

Thanks again for your input.
FrazerBee
  • Posts: 3

Harald

The perhaps best solution would be to create transition animations and not rely on interpolation for such transitions. So in your case it would be a turn animation which is played before your subsequent animation. Mathematical transitions will anyway not look very natural if the poses are very different.
User avatar
Harald

Harri
  • Posts: 3575

FrazerBee

As we have hundreds of animations triggered dynamically by the player that wouldn't solve our issue, unfortunately.

One solution we intend to try is to, in Unity, force the head bone scale to always be -1 or 1. I'll let you know how it goes!
FrazerBee
  • Posts: 3

Harald

This is a solution as well of course. Just be sure to not update the bone scale in Update() but by registering to the SkeletonAnimation.UpdateLocal delegate to ensure it's updated at the right time.
User avatar
Harald

Harri
  • Posts: 3575


Return to Unity