How to make sure entire room/level is shown on different resolutions using pixel perfect camera?

I’m using a pixel per unit of 32 and using a static pixel perfect camera that shows the whole room. I can get it to work in the game view but changing the resolution or building the game causes the camera to be either zoomed in or zoomed out. How do I get it to keep the pixel perfectness and make sure the room is completely seen. Similar to celeste. Thanks!

Ok I think I finally understand the basics of how the pixel perfect camera works. The reference resolution is basically how many pixel will be shown at your chosen Pixel Per Unit. So since I’m using 32 ppu sprites for all my sprites and I want 30 tiles to be shown horizontally, 32 x 30 = 960 so that is the X part of the reference resolution. Since I’m going for a 16:9 resolution and 1920/2 = 960 I can find the Y part of the reference resolution by doing 1080/2 = 540. In order to not see beyond the room I also crop frame x and y. I also decided to upscale render texture though I’m not too sure what it does in terms of resolution, but it does make particles look more pixely. I also went to project settings > Player > Resolution and presentation and only checked 16:9 and 16:10 since the other resolutions don’t work for my game.

If you start the scene now it still won’t really work, but if you were to build and run the game it works as expected. I also had a resolution dropdown to test it and it works. The only thing I don’t like is that it is only fullscreen with no black bars at a 1920 x 1080 resolution but I’m not sure how to change that.

If anyone knows if I could change the reference resolution lower but with the same ratio and increase the pixel ratio or something to have it fit more resolutions. I’m not sure if that is possible.