• RuntimesUnity
  • Animation doesn't do the same thing in game and in unity

Hi, I've just finished a spine animation, and it doesn't look at all the same in spine and in Unity.
The arms glitch, the hands aren't attached to the arms and the movements are jerky (you can see it in the video).
The video

All the other animations of this character and the characters in the game are functional.

We've never had a problem with spine before.

Do you have any idea where this might be coming from?

Have a nice day!

    Related Discussions
    ...

    To troubleshoot the issue where your Spine animation behaves differently in Unity compared to the Spine Editor, consider the following steps based on the contexts provided:

    1. Ensure Compatibility: Make sure that the versions of both the Spine Editor and the spine-unity runtime you are using are compatible and up to date. Mismatches between Spine Editor and runtime versions can lead to unexpected behavior (Anims play in editor but not on device).

    2. Check for Unity-Specific Issues: Sometimes, Unity might not update imported assets properly. Try manually refreshing the assets or re-importing the Spine project into Unity to ensure that all updates are correctly applied (Updating existing animations in Unity from Spine).

    3. Investigate Animation Settings: Look into how animations are queued and mixed in Unity. Incorrectly mixed animations or issues with non-looping animations transitioning into other animations can cause unexpected results (Spine animation displayed WRONG in Unity Spine 4.0).

    4. Review Export Settings: Ensure that the export settings in Spine are correct for Unity. Sometimes, issues can arise from how animations are exported from Spine (Bug in multi skin spine animation).

    5. Send Assets for Review: If after checking these areas the problem persists, consider sending the problematic assets to the Spine team for a closer look. This can help identify if the issue is with the Spine project or how it's implemented in Unity (Help!Some of my character’s animations are lagging in unity!).

    By following these steps, you can narrow down the cause of the discrepancies between your animation in Spine and Unity, leading to a solution that ensures your animation plays correctly in-game.

    Moinelle Unfortunately, it is not clear from the video alone what the cause is, but I would recommend checking to see if the animation looks correct in the Preview section that appears when the SkeletonDataAsset is selected in the Inspector window.

    If it looks right in the preview, there may be an implementation problem, so please show us the code that plays the animation.
    If it does not look right in the preview, there is something wrong with the export from the editor, so please send us a Spine project that can reproduce the problem via email: contact@esotericsoftware.com

    Hi !

    I also work on this project. We've made a little bit more investigation yesterday and actually we managed to find where the problem is coming from : Z spacing.

    This character has more than 250 slot with each a sorting index, index that is multiplied by Z spacing in Unity to avoid Z fight. In some animations (like the one Moinelle showcased in here video), some pieces are doing huge index "jumps". For example passing from 5 to 240 in order to be first in front of given slot and behind it a couple of keyframes later.

    In our game Z spacing is set to -0.001, so for instance a jump of 200 can create a significant offset.
    If we reduce the offset to be -0.0001 (10 times smaller) or if we avoid doing big index jumps within the same animation, the problem is solved.