• RuntimesUnity
  • Problem after upgrade Spine Timeline 3.8 to 4.2?

I'm upgrading Spine 3.8 to 4.2 recently. I have solved most problems. But I found the difference of updating stategy between 3.8 and 4.2.
For example, I have a girl playing "stand1" animation. Then I pause the timeline at frame 344.
After some operation, I have to change the time of timeline to frame 350.
Some strange problems happen: in 3.8, the girl will still continue play the "stand1". But in 4.2, the girl is force evaluated to the specific frame. The action seems to change to the frame suddenly.

I want to know if there is some method to solve this problem?

Related Discussions
...

The issue you're experiencing with the timeline behavior change from Spine 3.8 to 4.2 is likely due to differences in how the timeline evaluates animations between these versions. In Spine 4.0 and later, the timeline clips have been updated to offer more control over playback, including parameters like Don't End with Clip and Clip End Mix Out Duration. These parameters allow you to control whether the animation continues playing or pauses when the timeline is moved or paused. To achieve behavior similar to 3.8, you might need to adjust these settings in your timeline clips to ensure the animation continues playing as expected when you change the timeline frame.

For more detailed guidance, you can refer to the Spine-Unity 3.8 to 4.0 Upgrade Guide which discusses changes in timeline behavior and how to adjust them.

    Spinebot Not the mixing problem. I think it is because the logic of spine-timeline updating strategy changed.

    Harald Yes. But I don't think it is the problem.

    I have record a Screen Recording to show the difference between 4.2 and 3.8.
    4.2

    3.8

    In 4.2 version, the hand will be evaluated to a speciffic frame when timeline is set to a time manually. However in 3.8 version, the hand is playing animation continually. It's not affected when the timeline time changes.

    This is my simple code:

    public class Test : MonoBehaviour
    {
        [SerializeField]
        private PlayableDirector m_PlayableDirector;
    
        private void Awake()
        {
            GetComponent<Button>().onClick.AddListener(OnClick);
        }
    
        private void OnClick()
        {
            m_PlayableDirector.time = 0.5f;
        }
    }

    @Fish Thanks for the additional info. That might just be differences in the editor preview. Did you check it in the built executable?

    • Fish 回复了此帖

      Harald I have tried another demo, and the result is same. Which recording above is the correct result in your design? It makes me hard to upgrade from 3.8 to 4.2.

        I will make more testings in some days.

        Harald If I prefer the behavior of the 3.8 version, what can I do? It's very important for us to upgrade from 3.8 to 4.2.

        Harald It works like 3.8 version if I remove the code info.seekOccurred.

        bool clipStarted = (inputWeight > 0) && (lastInputWeight == 0 || info.seekOccurred || info.timeLooped);

        But it's not elegant to modify the code when upgrade the package everytime.
        Is there any idea to help me?
        Thanks.

          Fish Harald It works like 3.8 version if I remove the code info.seekOccurred.

          Yes, that's why I linked the commit above. Glad to hear you've got it working with these changes.

          Fish But it's not elegant to modify the code when upgrade the package everytime.
          Is there any idea to help me?

          You're right that this isn't perfect.

          You could create your own fork of the spine-unity runtime and modify just the required line. This would allow you to still receive updates easily while keeping this modification always applied. This is the cleanest solution, however requires some changes of your workflow and some time to set up.

          Otherwise you could write a patch file for this diff and after each time you update the runtime package re-apply this change.

          For just a single line change it could however likely be easiest to manually apply the change after updating the unitypackage.