Hello,
I’m building an android game and I’m stuck at trying to fit my game to all the different screen sizes.
After a lot of time messing with this, I came to understand that there are 2 issues here, one being the camera and the other one being the UI.
The UI seems to be pretty simple to adjust, I use the canvas scaler to scale objects and anchors to make objects stick to the corners of the screen.
But the camera issue gives me a lot of trouble. I tried to use something from the asset store to solve this, called Auto Letterbox which makes it so the game itself fits into any resolution by making black bars to fit the game to the whole screen.
I got a few problems with this method. The first one is now some of the UI will appear where the black bars are but the most important issue is that I don’t want there to be black bars. I want to fill those areas with my background which I can just make a really large one to fit all possible screens. Also, sometimes those bars will appear on the sides and I would like them to always go on top and bottom.
The ideal situation for me would be that the game will keep its original aspect ratio and fill the whole screen’s width while the parts left out on the top and bottom would be filled with my background which will just be there because it’s way bigger than any screen on any device in the first place.
Also, I might be wrong with what I think I need, so I would like to hear other suggestions.
Thank you!
It’s because the camera’s FieldOfView is a measuremeant of the vertical axis. So its fitting the camera view to the aspect ratio on the vertical axis. You can use camera.aspect to convert it to horizontal field of view.
Try doing what the post at the bottom here says.
Hope that helps!
@Natrad what is that voice
If you want world space stuff to always be seen by the cam you could try cinemachine multi-object focus or whatever it’s called.