- Edited
What is the difference with AttachmentThreshold?
In the Getting Started, Object Oriented Sample scene.
SpineboyBeginnerView.cs is a method control the shoot animation.
And I comment the 99102 sentence.
I cannot find the different animation in play mode.
What is the usage of AttachmentThreshold and MixDuration?
I have not least idea of this. :bang:
Thank you very much.
When you add two animations to a track of an AnimationState, eventually, the first animation will be done and the second one will start. The first and second animation can then be mixed. This allows for smooth transitions between animations. The MixDuration
specifies for how long they'll be mixed.
In your code example, an empty animation is added, and the mix duration is 0. That means that the first animation will not be mixed with the second animation at all, but the transition will be abrupt.
The attachment threshold is a bit more complicated. In Spine, you can change the attachment in a slot during an animation (e.g. swap a happy mouth with an angry mouth, etc.). When you mix between two animations, each could attach a different attachment. So which attachment should win? The animation that is ending, or the animation that is starting? With the attachment threshold, you can specify when during the mixing time the attachments from the second animation should be attached.
You can find API reference pages here: API Reference - Spine Runtimes Guide
Documentation of MixDuration:
TrackEntry mixDuration
Documentation of AttachmentThreshold:
TrackEntry attachmentThreshold
Please let us know if the pages explained everything or if you have any questions left.
Was it necessary to set the AttachmentThreshold to 1 even though there is no mix duration?
With no mix duration, you should not need to set the TrackEntry attachmentThreshold
. The previous animation is applied one last time so it can set everything it keys to the setup pose, then the next animation is applied on top. After that the previous animation is not applied anymore.