Pinning a static node on the screen.

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

Good afternoon. Guys, I can’t create a UI, the problem is to make the node with the UI be on the screen, it needs to be attached to the Camera2D, but this very camera already monitors the node where the player is, then the UI node repeats the movement of the camera (for Example, when the node with the player performs a jump or run, and accordingly the UI node does this), and is not static on the screen glued to the Camera2D. How do I make sure that the UI does not run after the position of the node (For example, the player), but is always static on the screen?

:bust_in_silhouette: Reply From: p7f

You shouldn’t add your UI as child of the camera… You should make it child of a CanvasLayer node.

Look at the docs about canvas layers, UI is one of the use cases.

I have read the documentation many times, but the scene does not move there, and I have the opposite…

VarionDrakon | 2020-09-06 11:29

Although okay, I’ll read the documentation again… Thank You and good luck!

VarionDrakon | 2020-09-06 11:38

Hi! I think i dont understand your question then… you want the ui to be always static on the screen, i.e. always visible in the same place in the monitor even though the camera is moving arround, right? If so, you need to put the gui as a child of a canvas layer instead of as child of the camera. What do you mean with “the scene does not move there”?

p7f | 2020-09-06 12:04