Resolution gets messed up after build

Hello,
I started learning how to use Unity this week. Programming is going smoothly, however I can’t seem to get the game resolution to work properly. When I build my game, only around 70% of the game shows up on the screen, and I can’t figure out why. The first image is how my game shows up in the software (both in the scene and game), and the second one is after the build. Is there any way to fix this directly in the hub or do I have to code a solution?
Any help would be appreciated, thank you!

9741685--1393648--Screenshot 2024-03-31 232535.png

There’s two (potential) things here.

Look up how to set resolution or to letterbox your game. If you want your game to handle all screen sizes, check here:

The first is UI. The answer is all in anchoring and scaling properly.

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.

The second is your game sprites, if they are not UI. Look into how to align things with the edges of the screen based on your camera settings. You can also use a package like Cinemachine that will help you frame all parts of your game.

There’s even a dedicated forum: Unity Engine - Unity Discussions

Thank you so much for the advice! I’ve installed Cinemachine and it’s already a big help.