• RuntimesUnityBugs
  • Animations appear correct in Spine editor, but are broken when imported in Unity

Dear Spine Support Team,

I’m using Spine 4.2.43 Professional and I’m encountering a serious issue when exporting animations to Unity.

In the Spine editor, all animations look correct — including those using IK constraints. However, once I export the project (JSON, Atlas, PNG) and import it into Unity (using the official Spine-Unity runtime), several animations appear broken.

In particular, bones that were controlled by IK in Spine seem to be in incorrect positions or orientations in Unity, even though they work perfectly in Spine. It looks like Unity does not reproduce the IK results properly at runtime, even when using the latest runtime.

I understand IK constraints need to be baked before exporting, but I’m working with a large number of animations, and manually baking each one is time-consuming and error-prone. Moreover, some constraints do not appear to bake properly, or the "Bake Constraint" option is greyed out even when selecting the constraint in the timeline.

Could you please clarify:

The correct workflow for ensuring IK-based animations export and play correctly in Unity?

If there is an automated way to bake all constraints across all animations?

Why the exported data differs from what I see in the Spine editor?

I’d greatly appreciate any help or documentation reference that could assist me in solving this problem, as it’s blocking my integration pipeline.

Thank you for your support and for the great tool!

Best regards,
Leonard

  • Misaki и Harald ответили на это сообщение.
    Related Discussions
    ...

    leonardopalmerummi Sorry for the late reply. I'm a bit confused after reading your explanation.

    Moreover, some constraints do not appear to bake properly, or the "Bake Constraint" option is greyed out even when selecting the constraint in the timeline.

    There is no such option as “Bake Constraint” in Spine. Can you show us a screenshot of the option you are referring to that is grayed out?

    leonardopalmerummi I understand IK constraints need to be baked before exporting

    They don't. As Misaki asked, which baking functionality are you referring to?

    When I export my animations from Spine to Unity, they appear broken—they're not the same as in the Spine project. I went back to using version 4.2.42 Pro because version .43 was giving me issues. I had been working smoothly for a long time, even with version .43 for a while, but then the animations I modified in the Spine project no longer matched what I saw in Unity.

    And yet, the runtime is correctly installed. Again, everything worked fine until a few days ago. The problems started when I modified an animation that uses inverse kinematics. Now, after switching back to version 4.2.42, everything seems to be working properly again.

    I'd like to know if my export settings for Unity are correct.

    @leonardopalmerummi In general there is nothing obviously wrong with your export setup. Unfortunately it's impossible to help based just on the limited information provided, there are no known issues with IK constraints and the latest 4.2 Spine Editor version. Could you send us a Spine project and minimal Unity project which still shows your issue? You can send it as a zip file to contact@esotericsoftware.com, briefly mentioning this forum thread URL so that we know the context.

    BTW: You haven't answered what you mean by baking constraints yet, or did you confuse something there?

    Seeing JSON export being selected: For production you should later prefer binary skeleton exports (binario, .skel.bytes) over JSON exports, as they are smaller in size and faster to load (also documented here).

    As for the "baking" of animations, I think that was mostly something ChatGPT made up—since, as you said, that concept doesn’t really exist. I’ve always worked fine with constraints in all the animations I’ve made and never had any issues. I’ve always exported using JSON.

    This is the only problem I’ve encountered. I'm trying to export the scene again soon to reproduce the error, but it might be related to the runtime. I downloaded the version that matches Spine 4.2, and again, I’ve never had any problems with it until a few days ago.

    • Harald ответили на это сообщение.

      leonardopalmerummi I'm trying to export the scene again soon to reproduce the error, but it might be related to the runtime.

      Yes, if you can still reproduce any discrepancies between the editor and the spine-unity runtime, please do let us know, as we would be happy to fix any issues.