• RuntimesUnity
  • Problem when export file to Unity

IWhen I export the Spine file, I get 2 .png image files and images of the frame by frame animations I exported before. Then, when I import it into Unity, the message below appears. I use Spine version 4.2.40 and my Unity has Spine-Unity runtime 4.2.100, Spine Csharp Runtime 4.2.36. Why do I get this and how to fix it? I have some information in pictures bellow.Thank Spine's team so much.




  • Misaki відповіли на це.
    Related Discussions
    ...
    • Змінено

    The issue you're experiencing when exporting from Spine and importing into Unity is likely due to a version mismatch between the Spine Editor and the Spine-Unity runtime. You mentioned using Spine version 4.2.40 and the Spine-Unity runtime 4.2.100, which should be compatible. However, ensure that all components, including the Spine C# runtime, are correctly updated to match the Spine Editor version. Additionally, check if the exported assets include both the .atlas.txt file and the corresponding PNG textures, as these are necessary for proper import into Unity.

    tuanviet79 In your screenshot I can see that the Atlas extension field in the Texture Packer Settings is set to .atlas. Make sure that the extension is .atlas.txt in order to successfully import it into Unity.

    That's so helpful. Now I can imported file in Unity after update Spine- Unity runtime. But when I exported file, it had 3 picturers ,.png. Why do I get this and how to fix it? Thank you so much.

    • Misaki відповіли на це.

      tuanviet79 I assume that the pages are packed by folder because you selected Image folder in the Texture atlas section of the Export Settings window. You can combine pages into one by switching this option to Attachments or by checking the Combine subdirectories checkbox in the Texture Packer settings:

        Misaki Thank you. I did it.

        Misaki Can you explain more why it have 3 picture when I exported ?

        • Misaki відповіли на це.

          tuanviet79
          If multiple Texture Atlas page images are exported, there are two possible reasons:

          1. because the images are too large to fit all the images on one page, or because the Max width/height of the page is too small.
          2. you have placed the images to be packed in a subfolder like the following image, and have selected the Image folder in the export settings, or you have not checked the Combine subdirectories checkbox and are running the texture packer separately.

          The screenshot above shows the folder structure of mix-and-match, our official example skeleton. In the case of mix-and-match, the pack.json file is included in the images folder. If you open this in any text editor, you will see the following:

          If Spine finds a pack.json file in the input folder during packing, it will pack according to the setting specified in the JSON file. So even if you try to pack a mix-and-match sample skeleton, select the Image folder in the Export Settings window, and uncheck Combine subdirectories in the Texture Packer settings, the output will only be one page:

          If you remove the pack.json file, leaving the export and texture packer settings as they are, you will get the following results: