Issue with Menu Background Graphics in Screen Space - Overlay mode

Hi!

I am encountering a problem while trying to create simple 2D menus for my PC game project using the Screen Space - Overlay mode and an orthographic camera.

I have a ‘Main Menu’ folder as a child object of the Canvas, and it is set up to use the Rect Transform stretch in all directions. This folder contains subfolders for Buttons and Background graphics, which also have Rect Transform components set to stretch in all directions.

The issue I am facing is that the buttons scale and align perfectly when I scale the game view in the editor, but the level background graphics do not.

When I scale down the game view, the background graphics do not remain centered and scale down towards the bottom left corner. Conversely, when I scale up the game view, the background graphics scale up towards the top right corner.

Additionally, when I move the camera, the background graphics move along with it. In Screen Space - Overlay mode, I believe the graphics should remain in the same location within the camera’s view, regardless of any changes to the camera’s position.

I would greatly appreciate any assistance in resolving this issue. Thank you! :slight_smile:

I am using Unity version 2022.3.1f1.

1 Like

I managed to fix the issue on my own. It seems I need Canvas renderer and Image components for graphical elements instead of Sprite Render.

2 Likes