• RuntimesGodot
  • SpineSprite visible in Editor but invisible when running the scene

Hi,

I exported my spine character in .skel and created a resource for the Godot 4.2.2 Runtime (With Spine 4.2.33).
I created a SpineSprite node and assigned the newly created resource as explained in the tutorial.

Everything looks perfect in the editor, I can preview the skins and the animation and visually everything is here as expected.

But the issue is that when I run the scene, then the SpineSprite become invisible.

*I run the SpineSprite in a single simple scene to be sure no code run on the background or to avoid a z-index/layer problem for example.

I also tried the Forward+ and Compatibility Mode, restarting Godot, reinstalling GPU Drivers, using the json instead of the skel and the same issue is here:
Everything is here in the editor but when running the character don't appears. I also check the Remote Tab while running and the node should be visible, the resource is loaded as expected etc.

What could be the issue and how to fix it considering everything looks good in the editor, but not at runtime?

Related Discussions
...

It sounds like you've followed the correct steps to set up your SpineSprite node in Godot, but are encountering an issue where the sprite is not visible at runtime. Here are a few troubleshooting steps and potential solutions to address this issue:

  1. Check the Z-Index and Layer Settings:
    Ensure that the SpineSprite node is on the correct layer and has an appropriate Z-index. Even though you mentioned checking for Z-index/layer problems, double-checking these settings can sometimes reveal overlooked issues.

  2. Verify the Animation State:
    Ensure that the SpineSprite is set to play an animation at runtime. You can do this by adding a script to the SpineSprite node to set an animation when the scene starts:

       extends SpineSprite
    
       func _ready():
           var animation_state = get_animation_state()
           animation_state.set_animation(0, "walk", true)
  3. Check for Errors in the Output:
    Look at the Godot output console for any errors or warnings that might indicate what is going wrong. Sometimes, missing resources or other issues can cause the sprite to not render correctly.

  4. Ensure Resources are Properly Imported:
    Make sure that the .skel, .atlas, and .png files are correctly imported and associated with the SpineSkeletonDataResource. You can re-import these files to ensure they are correctly recognized by Godot.

  5. Debugging with the Remote Tab:
    Since you mentioned using the Remote tab, ensure that the SpineSprite node is indeed visible and not hidden or disabled. Check the properties of the node in the Remote tab to confirm that it is set to be visible.

  6. Compatibility with Godot Version:
    Ensure that the version of the spine-godot runtime you are using is fully compatible with Godot 4.2.2. Sometimes, using a different version of the runtime or Godot can resolve such issues.

  7. Check for Custom Shaders or Materials:
    If you are using any custom shaders or materials, try disabling them to see if the issue persists. Sometimes, custom materials can cause rendering issues at runtime.

  8. Example Projects:
    Refer to the example projects provided in the spine-godot documentation, such as example/08-animation-player or example/03-mix-and-match, to see if they work correctly. This can help determine if the issue is specific to your project setup.

If none of these steps resolve the issue, you might want to create a minimal reproducible example and compare it with the example projects provided in the documentation to identify any discrepancies.

I checked and tried everything you said and still have the issue.
The SpineSprite is perfect on Editor but nothing appears at run

If I activate the Debug Yellow Bones in the SpineSprite and I make the Debug Collision Shapes visible when running, I can see the bones and doing the animation, but its like it cannot show the appropriate PNG on it.

I checked the resource in the editor and the PNG looks correctly imported, I tried also to put the PNG in a Sprite2D to test and it appears. Anyway the Spine character is displayed perfectly in the Editor so it should appears as expected when running the scene...

Any help is welcome, thank you

Alright, I solved the issue, it could be useful for others:

I had to set the skin of the character by code on _ready() using get_skeleton().set_skin_by_name("skinname")

It looks a simple mistake...
But I remember that in previous versions of the runtime and on tutorials also, we just had to set the "Preview Skin" in the editor and that way we didn't have to set the skin by code.

It seems that now with the Godot 4.2.2 we are forced to set the skin by code and cannot only use the "Preview Skin" that is used by default in the Editor.

You can mark the topic as solved, thank you.

    Musashogi Sorry for the trouble!

    But I remember that in previous versions of the runtime and on tutorials also, we just had to set the "Preview Skin" in the editor and that way we didn't have to set the skin by code.

    You are right. Previously, the skin set in the Preview Skin was used in the scene as is, but when fixing a bug discovered about two months ago, the preview skin was modified so that it does not affect the runtime. The ticket for the bug can be found here: EsotericSoftware/spine-runtimes2530