CanvasLayer Items from instanced scenes do not show up

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By lambi

I feel like I am missing something easy here, but can’t figure it out…
I’ve got a simple scene supposed to be instanced, set up like this:

Rock

  • Sprite
  • StaticBody2D
  • Canvas Layer
    • ColorRect
      -Label

When I drag that scene into my main one

Main

  • …[some stuff]…
  • Rock1

both the ColorRect and the Label do not show up. They are visible when opening the “Rock”-Scene", just not when instanced into the main one. Visibility is set, as is a font type, font color etc.
What obvious thing am I missing here?

Ok, I think I figured it out by trial and error… seems I should not use a CanvasLayer node in the to-be-instanced scene. If I do, any child of this layer will show up at 0,0 in the main scene. If I simply add the ColorRect and Label directly to the rock, they do show up in the main scene as they shoudl. Guess I did not understand the function of CanvasLayers correctly… Will leave the question open for the time being, maybe there is a more elegant way to handle this?

lambi | 2022-12-30 14:09

1 Like

I’m running into the same issue, just using non-instanced canvas layer for now… so strange how it imbeds the child nodes upon scene instancing and then I don’t know how to reference them within the script.