Godot Version
Godot_v4.6.1-stable_mono_win64
Question
My GUI has its top-left corner in the center of the Camera2D view. I’ve tried many different things, no matter what i do, the top-left corner is in the center of the screen.
The “scene” hiearchy looks like this:
GameScene (Node2D) (root)
–>World (Node2D)
—–>Camera2D (Camera2D)
—–>Player (Node2D)
–>CanvasLayer
—–>GUI (Control)
——–>ColorRect (ColorRect)
Everything has x, y set to 0,0. Scale and Size is 1,1 on everything (except colorrect that has 40, 40, color rect is just used to confirm that the gui is in the center when i press play)
CanvasLayer:
Follow Viewport: ive tried both true and false (with all setting combinations)
Camera2D:
When i use Anchor Mode = Fixed Top Left, then GUI top-left corner aligns with top-left corner of camera view / screen view. But i feel like there should be a way to align the GUI with camera anchor mode set to drag center?
GUI (Control)
Anchor Preset: Top Left
Game Settings:
Display:
Mode: I’ve tried both Canvas_Items and viewport (with all setting combinations)
Aspect: I’ve tried both keep and expand (with all setting combinations)
I have watched a bunch of youtube tutorials, asked chatgpt and grok. I feel like im doing everything right, yet the result is not what i expect. I’m pulling my hair out. Am i even doing any thing wrong? I’ve tried having the root node be a normal “node” instead of a “node2D”. I’ve tried not having a CanvasLayer and just have the GUI (control) directly under GameScene (node2d). I’ve tried recreating the entire scene from scratch, just adding nodes and not touching any settings. I’ve tried making seperate scenes for the gui and game and then saving them as assets and then dropping them into a new scene.
I’ve tried more things, just cant remember everything i’ve tried. No matter what i do, the GUI top-left corner starts from the center of the camera/screen view. There is no code in the project, its a completely new project, no assets, no scripts, just the nodes.