Camera's Size changes when running

Hi, I’m new to Unity and have been tinkering around in 2D. I’ve run into an issue with my camera.

I have my main Camera and a Cinemachine virtual camera, and both have their Orthographic Size set to 8. I’ve include screenshots of the inspector.

Main Camera:

Virtual Camera:

Everything looks fine in the Scene and Game views before I run the game. I am seeing the expected 16 units in the vertical direction, as seen here:

But when I run the game the Camera’s Orthographic size changes to 8.4375 for some reason. And the running game view camera is slightly off, as seen here, showing an extra few pixels on the top and bottom:

I do not have any scripting that messes with Camera positions or sizes. Any ideas about what I might be doing wrong here?

Just a guess… is it the “Game Windows Guides” being enabled on the VCam?

Turns out it was PixelPerfect adjusting my camera. I fixed it by setting PixelPerfect’s Y Reference Resolution to (2 * OrthographicSize * PixelsPerUnit), (256 in my specific case) and checking Crop Frame Y.

2 Likes

Hello guys, did you got the answer now?
I think I got it,
do the math, 1080 / 64 = 16.875, 16.875 / 2 = 8.4375
it is why your camera automatically changed to 8.4375, and it should be the correct number.
why it should / by 64 ?? because in unity, 1 grid is = 64px. 1080P actually should showing 16.875 grid, not 16.