11-6-2019: Spine Mixing Causes Event Dropping

Skeleton Animation objects in Unity by default blend animations together that you have queued on the same track by starting the next animation before the first one is finished.

This was causing the OnEvent triggers we set up in our Spine files (such as “JumpStart”, “AttackEnd”, “Interrupt”) to be ignored at runtime.

Since we mix our animations together on the drawing side, the fix for our case was setting the default mix to 0 for each Spine Asset we are bringing into the game that has events.

There is more information about about handling Spine Events with mixing on the Spine Website.

If you wanted to keep the mixing behavior that Spine provides by default (where animations are blended together with code rather than with drawing), you have to adjust the Event Threshold within a C# script to allow for event reading with one of the settings described below (note: taken from Spine Documentation).

Spine2D User Events During MIxing

A TrackEntry’s EventThreshold controls how user events are treated during the mix duration.

  • With the default value 0, user events stop being raised immediately when the next animation starts playing.
  • If you set it to 0.5, user events stop being raised halfway through the crossfade/mix.
  • If you set it to 1, events will continue to be raised up until the very last frame of the crossfade/mix.

Leave a Reply

Your email address will not be published. Required fields are marked *