• RuntimesUnity
  • Spine asset preview window in Unity inspector vs Spine preview window

Hey Spine team!

Myself and our artists have noticed that in the Unity inspector window of a spine asset when looping an animation, it seems to blend differently (in a bad way, jerky interpolation) then when looping the same animation in Spine's preview window (good way, smooth interpolation). I read the following over on https://esotericsoftware.com/spine-unity-main-components#Main-Components

We do use SkeletonMecanim with our spine objects in the scene, however I'm wondering if the preview window uses Mecanim under the hood to drive those animations and thus would fall under the warnings about SkeletonMecanim not guaranteed to match?

Thanks a heap for the insight!

    Related Discussions
    ...

    The discrepancy you're observing between the Unity inspector preview and the Spine preview window is a known issue. The Unity inspector preview for Spine assets uses the Spine Runtime to render animations, which should ideally match the runtime behavior in your game. However, there are some limitations and differences in how Unity's editor API handles these previews, especially when using Mecanim.

    The preview window in Unity does not use Mecanim under the hood; it uses the Spine Runtime directly. This means that while the preview should be similar to what you see in the Spine editor, there can still be differences due to how Unity handles animation states and transitions. The jerky interpolation you're seeing might be due to these differences or specific settings in your Unity project.

    For the most accurate representation of your animations, it's recommended to test them in Play mode within Unity. This way, you can see how the animations will behave in the actual game environment, including any transitions and blending that might not be accurately represented in the preview window.

    For more detailed troubleshooting, you might want to check if the issue persists with different SkeletonDataAssets or if there are any specific settings in your project that could be affecting the animation playback.

    I'll add one more nuance here about this that I should have mentioned earlier.

    The other animations associated with this skeleton have a similar animated motion, key spacing, and timing and those do appear to play smoothly as expected in both Spine and Unity. The one difference is that the jerky animation described above did have some rather large weights on the in/outs of these keys that the others didn't. Between one pair of keys across 5 frames, the weights (key 1 out, key 2 in) created a very tight 'S' curve that lined up about in the middle of the two due to the weights being pulled super far away (likely on accident.)

    Would the way spine's preview and unity's preview still be different in this way? This jerky motion is in the middle of the animation and not necessary blending in or out to another in the preview window (unless, I suppose, itself or a setup pose?)

    Thanks!

    jhoferLNW2332 Myself and our artists have noticed that in the Unity inspector window of a spine asset

    By "a Spine Asset" I assume you mean the SkeletonDataAsset and not e.g. an AnimationReferenceAsset.

    In general, the Unity Editor update cycle is not consistent and reliable enough to be used as a high-performance view. As a consequence, the Inspector preview is not intended for precise analysis. See it more as a tool showing animations so you know which name is which animation. In general the preview-playback is using the AnimationState API in a standard way, just at a low variable framerate.