This is the testing Godot forums! All forum posts unique to this forum will be deleted! Please use the main forums here for any posts you want to keep. All forum rules still apply.

Camera2D has a grey box covering the top part of the window

TheRunningStefTheRunningStef Posts: 10Member

Hi, so I'm having this strange issue where the top part of the screen is grey when the camera node is switched to current:

If i turn the camera node off current, the screen looks fine:

So Im really confused whats causing this, I've tried making a new node and attaching the script to it but nothing changed. As far as I can tell there is nothing in the script causing it, but I can upload screen shots of that too if that is the issue.

Thanks in advance


  • TwistedTwiglegTwistedTwigleg Posts: 2,561Admin

    Looking at the images provided, it appears that when the camera is set to current, either the background does not move so it is centered in the camera's view or the background does not scale to fit the size of the camera. Since some of the sky and mountains are cut off in the first image, I'm thinking it is likely a scaling issue.

    What node is your background image using? If it is a Control node, you probably need to set it to have an anchor/layout mode of Full Rect, so it scales to cover the background of the camera. If it is a Node2D node, then you may need to adjust your project settings and their expansion modes and/or write a script that keeps the background image centered in the camera.

  • cyberealitycybereality Posts: 928Moderator

    The gray box is probably just the clear color behind the background. Meaning, it's not a box, it's just empty space where the background is missing. Also, notice the background image is not the same in those two pictures. Look at the sky and the mountains. They are different colors. That makes me think it's another image.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.