How to make UI pixels the same size as other asset pixels?

Hello, I am new to Unity but understand a lot of the basics behind game design and different fundamentals, but right now am trying to create a project I have been making assets for. I have made a top down shooter, I have my player made and have a movement script with a camera follow, all is good. Now I am trying to work with UI and am starting to run into some issues. All my art I have made is pixel art, and I am now trying to make sure all my assets have the same pixel sizes and Pixels Per Unit (PPU) . As I am creating UI, I am running into the issue of preserving the same pixel sizes, and am not sure how to keep UI elements having the same pixel sizes of game assets. For reference, all my assets have a PPU of 16, and the screen size for the UI and whole game resolution is 480x270 pixels. when I press play and move around, my UI background right now has pixel sizes smaller than my game assets. Any ideas as to how I should fix these issues?

Here is an image for context. Notice the UI around the edge of the screen, and the 2 player models in the middle circle, and note the pixel sizes or different.

If you mix SpriteRenderers with CanvasRenderers you need to keep them in sync size-wise.

If you keep the SpriteRenderers fixed (sounds like you have decided already?) then the tweaking will likely be done via the CanvasScaler.

Here’s more reading:

Here are the official docs on how to make your UI handle various resolutions and aspect ratios cleanly:

Here are some notes on UI Anchoring, Scaling, CanvasScaler, etc:

Usually you need to choose a suitable ScaleMode and MatchMode in the Canvas Scaler and stick with it 100%. Generally if you change those settings you will often need to redo your UI entirely.

I also use this CanvasScalerOrientationDriver utility to make sharing UI for Landscape / Portrait easier. Read what it does carefully.

I will look into these, thank you for the information and resources. I was looking into the problems I was having further and was noticing that my camera was zoomed in a little too much, but wasn’t sure if it were possible to set the camera “zoom” or camera focus area to only render an area of 480 x 270 pixels based on my UI and asset designs? not sure if these camera settings are available within the provided documentation.

Look up letterboxing techniques.

There are many approaches depending on how you’re doing things.