• Unity
  • Spine Unity bug with displaying incorrect attachments

In the current project I'm working on, I'm having an issue where after changing from one animation to another in Unity, the wrong attachments are displayed.

I have a bug reproduction project, but I can't share it here because the contents are under NDA. (However, I was told by support that I'm obligated to make a thread here anyway.)

Related Discussions
...

Thanks for creating the forum thread. I'm posting the same reply that I've sent via email here, so that others can also benefit from any insights.

I just had a look at your reproduction project. First I was assuming that you are facing problems with the official spine-unity Timeline integration behaviour. After having a look at your reproduction scene, I noticed that you are having problems with your own custom written SpriteSwitchClip. In the associated SpriteSwitchMixerBehaviour you are calling methods of your class Scr_SpineCtrl which are calling AnimationState.SetAnimation, but I don't see any call to skeleton.SetToSetupPose in your code, which might be the cause of the problem why you see different behaviour when rewinding the playhead back from the second clip to the first clip.

Please note that proper implementation of a Timeline clip component is not trivial. You could have a look at the code in SpineAnimationStateMixerBehaviour which shows different code paths inside and outside of play mode. Unfortunately this is necessary to provide similar outcome when scrubbing the playhead vs playing back the complete Timeline in Play mode. Nevertheless, both modes will not create the same outcome. The recommended way to preview the Timeline properly is to enter play mode and play back the animations in a forward manner. When scrubbing backwards, you might end up with an incorrect preview state.

If you have any follow up questions, please feel free to post them here.