• Unity
  • Default EventThreshold value

Hello,

at this page: Coding for Spine Events and AnimationState callbacks: Events During Mixing

It states regarding EventThreshold:

"Setting this or the default value to the appropriate value for your animations is important"

But - how do I set the default value? It appears to be hardcoded to 0 in AnimationState.NewTrackEntry().

Thanks!

Related Discussions
...
  • Змінено

You are right, there is no configurable default value, this documentation part is indeed outdated, I updated the documentation page accordingly. Thanks for reporting!

You need to set it via the received TrackEntry at every added or set animation:

TrackEntry trackEntry = skeletonAnimation.AnimationState.AddAnimation(trackIndex, "run", true, 0);
trackEntry.EventThreshold = 0.5f;