So , when I change size of screen the main camera position size is 1 all the time and most of my gameojbects get cut of when I try to run game on smaller screen .
Im making 2d game with one scene that is not moving .
So what Im asking is how to change the main camera depending on screen size .
The camera size how it is now is set to 5 .
that’s a common problem of keeping a game screen consistent across all aspect ratios and there is not one perfect formula to deal with. one device shows 4:3, another 16:9, so where to cut the screen? vertical or horizontal?
The Unity Canvas deals with that problem with it’s components you can configure for UI stuff. one valid approach however is to define a resolution and base every aspect on that. screen height is “orthographic size * 2 * 100”. for the width you multiply that with the cameras aspect ratio.
knowing that you can write code that calculates the needed height for the camera based on the used aspect