How do I make it so a UI element can be ontop of another scene?

Godot Version

Question

How do I make it so a UI element(on its own scene) shows up on another scene without switching scene to the UI one?

set the z_index or move the children around, nodes higher in the scene tree are drawn behind nodes lower on the tree

Use a CanvasLayer

4 Likes

This is the right answer.

in which order should I set up the ui scene?

What do you mean by order?

image
This is how I have set up the scene. Have I done it right?

And should I add the NPC_Chat scene to the main scene too?

I don’t know your full set-up but that should be correct, just try it out and see if it works, that’s always the best way

When I turn on the canvas layer to follow the viewport the ui does not show up.

I even added the UI file to the main scene but it does still not show up

As far as I know you don’t want the canvas layer to follow the viewport, because that is not the same as your camera, if you want the canvaslayer to always show on the screen no matter where you are, disable follow viewport.

2 Likes

Thanks, got it to work!

1 Like