Show GUI while Camera2D is moving

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

My tree is build this way:

root
→ Player
→ ->Camera2D
→ CanvasLayer (GUI)
→ -> Gui Stuff (Labels etc.)

The Camera2D follows the player, that works fine. But the GUI stuff is not shown at the camera’s current position.

What can i do?

That’s really weird, that should work

exuin | 2021-03-31 19:50

Maybe there’s a problem with the CanvasLayer? While it should be independent of where it is placed in the scene tree, maybe it’s following a different transform than the player or camera transforms? Have you tried making the CanvasLayer a child of the Camera2D?

Ertain | 2021-04-01 04:55

I already tried that, but it didn’t solve my issue :frowning:

YAGU | 2021-04-01 09:14

Try to debug the screen larger. Are those GUI’s is static? if yes, then your problem is in the viewport

Mrpaolosarino | 2021-04-01 13:04

:bust_in_silhouette: Reply From: Firty

The canvaslayer must be a child of the player. Brother of the camera. And the camera has to be in current mode.

root:
	Player:
		GUI
		Camera