• RuntimesUnity
  • spine timeScale=0 , Keep setting the animation , StackOverflow

Spinebot I know the cause of the problem, but I think there should be an option to limit the maximum number of mixed animations, sometimes I just need to set animations when timescale=0

Related Discussions
...

Harald I have sent it to you. The subject of the email is spine StackOverflow

    a674878955 I have confirmed that I can open the Unity project attached to the email you sent us. I'm not sure if it's because I didn't open it with exactly the same version of Unity, but I didn't get any errors when I opened the "SpineTest" scene in it. (I opened your project with Unity 2022.3.29f1.) Could you provide the steps to see the error with the project?

      Misaki
      I don't know why you didn't repeat that success, but I'll tell you more about how it happened

      First, the animation End event is not executed when the condition is met

      Then, when animation is set, the current track is assigned to the mixingFrom of the new track

      SetAnimation=>SetCurrent=>current.mixingFrom = from


      Finally, enable breakpoint debugging, where you can see unlimited mixingFrom

      Harald
      I'm not sure why you didn't repeat the problem, maybe your unity automatically handled the stackflow problem, maybe you didn't wait long enough, I explain how the problem happened ⬆⬆⬆

      Misaki
      So setting mixingFrom to null will solve this problem

              //internal mixingFrom => public mixingFrom
              skeleton.AnimationState.GetCurrent(0).mixingFrom = null;//or ClearTrack()
              skeleton.AnimationState.SetAnimation(0, "a1", false);

        a674878955 Thank you for the additional information! We have tested again and have confirmed that we can reproduce the issue at higher FPS. We are currently investigating the cause and will let you know as soon as we find out.

          7 dias depois

          @a674878955 The spine-csharp runtime has been updated (in this commit) to automatically cover this situation and no longer produce a stack overflow.

          A new spine-unity 4.2 package is available for download here as usual:
          https://esotericsoftware.com/spine-unity-download

          Regardless, you should in general not repeatedly call AnimationState.SetAnimation every frame. We've added a documentation section here (the "Important Note" subsection):
          https://esotericsoftware.com/spine-unity-main-components#Setting-Animations

            Harald Misaki
            Thank you very much for your help and support. I wish spine better and better. Also, hopefully ts/js will fix this issue as well

            @a674878955 Glad it helped. The commit will be ported to all runtimes, so TypeScript will be covered as well. You can watch this issue ticket which lists porting progress of the different runtimes:
            EsotericSoftware/spine-runtimes2705

            Yup! Available in all ts runtimes in 4.2.68!