• RuntimesUnity
  • Runtime multi track animations problem

In spine unity runtime, we want play loop animation1 on track0 and loop animation2 on track1.

The corrent behaviour is like this in spine editor(4.0.64):

however after mixed them in unity runtime(spine-unity-4.0-2021-10-02.unitypackage) the blue part has jitter like this:

After some test, we found if we change dopesheet keyframes from image1 to image2, the result will be correct.
Image1: (same rotation on frame0 frame20 frame90 frame140)

Image2: (slightly change rotation on frame20 / frame90)

So we think maybe there'll be some mechanism in csharp-unity runtime about resolving animation Json while keyframe data is {"time":0.8} instead of {"time":0.8, "value":-5.34}?

"333":{"rotate":[{"time":0.8},{"time":1.6,"value":-5.35},{"time":3,"value":-0.22},{"time":3.6}]}

I'v sent a minimal project which can reproduce the problem to you via email: contact@esotericsoftware.com
Please have a look at your convenience, thanks!

    Related Discussions
    ...

    It seems like you are experiencing jitter issues when mixing two looped animations on different tracks in the Unity runtime. This issue might be related to how keyframes are handled in the runtime, especially when keyframes have identical values at different times.

    Based on the information provided, here are a few steps you can take to troubleshoot and potentially resolve the issue:

    1. Check Animation Cleanup: Ensure that Animation Cleanup is disabled in your Spine export settings. This setting can remove keys that are identical to the setup pose, which might cause issues when mixing animations.

    2. Update Runtime: Make sure you are using the latest version of the spine-unity runtime. There have been several fixes and improvements in newer versions that might resolve your issue. You can download the latest version from Spine Unity Download.

    3. Hold Previous: Try enabling trackEntry.holdPrevious for your animations. This can help maintain the state of the previous animation when mixing.

    4. Keyframe Adjustments: As you mentioned, slightly changing the rotation values at keyframes can resolve the issue. This suggests that the problem might be related to how identical keyframes are handled. Adjusting the keyframes to have slight variations can help avoid this issue.

    5. Minimal Project: Since you have already sent a minimal project that reproduces the problem, the support team will be able to investigate further and provide a more specific solution.

    For more detailed troubleshooting, you can refer to the following forum discussions that might be relevant to your issue:

    Please let us know if you need further assistance after trying these steps.

    • Düzenlendi

    ara Thanks for sending the file for reproduction! It seems that the problem is with Animation clean up, as Spinebot replied. If you export the skeleton with Animation clean up turned off, the jitter you mention will not occur in Unity.
    Unfortunately, I'm not sure why Animation clean up causes the problem. I think Nate will be able to explain why this happens when you enable Animation clean up later.

    • ara bunu yanıtladı.

      Misaki Thanks Misaki!You're right the problem is with Animation clean up.

      Unfortunately, I'm not sure why Animation clean up causes the problem

      Maybe it‘s because runtime not recognize cleaned up json which is shorter and lose {"curve":"stepped"}

        ara Animation clean up has nothing to do with the runtime side, the keys identical to the setup pose (or duplicate keys in the middle of an animation) are removed during export.

        When you use clean up on export, what you see in the editor is not the same. You can apply Clean Up in the editor and watch watch keys it deletes, and then you are likely to see the same behavior as at runtime.

        Animation clean up deletes some keys. When using an animation on a higher track, you should check Layered. See here:
        http://esotericsoftware.com/spine-keys#Clean-Up

        • ara bunu yanıtladı.

          Nate
          Thanks for your detailed explanation Nate and Harald!
          We can't find Layered in Editor is it in newer version than 4.0?
          Anyway we'll leave Animation clean up turned off first.

            ara Ah, that's right. The Layered option was added in 4.1, so it cannot be used in 4.0. We apologize for the inconvenience, but we have made a lot of improvements in Spine 4.1 and 4.2, so we would appreciate it if you would consider upgrading.

            • ara bunu beğendi.