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

TheRunningStefTheRunningStef Posts: 10Member
in 2D

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,655Admin

    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: 927Moderator

    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

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file