• Editor
  • An issue during mix/transitioning between two animations

Related Discussions
...

Hi. I have 2 animations: idle and attacks using setMix() function in runtime. When I transition from idle to attack (has effect slot/attachment), the effect is shown during the transition. How can I make the effect to show only during the attack animation and hidden during the mixing/transitioning?

The animation that is mixing out can be set to not apply attachment, event, and draw order timelines using:
TrackEntry attachmentThreshold
TrackEntry eventThreshold
TrackEntry drawOrderThreshold

I'm afraid the animation that is mixing in always applies all its timelines. You'd need to edit AnimationState or manipulate Animation timelines to avoid applying some timelines for the mixing in animation.

I've tried setting attachmentThreshold to 0 but it didn't do anything and I'm not sure how to edit AnimationState or the timelines. The issue also shows in Spine's preview.

The thresholds are for the animation mixing out. The animation that is mixing in always applies all its timelines.

Gotcha. So with timelines, I'm not familiar with them. How can I find the attachment and make sure that it's not being mixed in/shown too early during the transition?

You could look at the animation's timelines, Animation timelines, find the AttachmentTimeline, remove it from the animation until you want it to be applied. This will affect all skeleton instances, who share the animation instances.

However, it might be easier to play different animation. Eg, if you are at idle, instead of playing attack, play idleToAttack which doesn't key the attachment changes during your mix duration. Or, if you want a single attack animation, play an animation that is the brief transition to the attack, then play attack.

Thanks Nate.