I made a build of my game and have the ability to set the games’ resolution through a settings menu in-game.
I have quite a few resolutions to choose from but if I go from 1920*1080 to anything lower, the window starts to have black sections at each side. Also, if I go to the lowest res, it’s like there is a section of the old screen still there (the pictures below try to show this). You can see that there are two FPS counters in the top left and there is a section cut off from the right (and left side) too.
What is the best way for me to update the window to keep the game filling the screen?
The problem isn’t resolution, it’s aspect ratio.
1280 / 768 = 1.666667
1920 / 1080 = 1.777777
In the Unity editor, on the Game tab, try playing with the Aspect Ratio drop down on the top-left, and you’ll be able to test in the various standard ratios, or a custom one.
Unfortunately, making your game work in any aspect ratio is a huge topic. There are a lot of articles you can find online, but the basic gist is that you need to design your content in such a way that it works well with any aspect ratio you support without additional code. In the UI, that means using the borders of the screen as reference points instead of absolute positioning. In 3D, it takes some complex camera work if the scene isn’t designed for it.