- Home /
Keep Aspect Ratio like in Unity Editor
Basically what I want to achieve is keeping my game in a 16:9 Aspect Ratio, even in Windowed mode when scaling it around. In Unity Editor it works when I just select 16:9 Ratio but in Build it won't work. That's how I want it to work in Build:
As u can See in the Pictures it always keeps a 16:9 Ratio. Once the Dark-Grey Bars are left and right (First Picture) and once they are over and under (Second Picture). How can I achieve this in Build? Thanks in advance. ~ Julian
Answer by FrancisWolowitz · Aug 03, 2021 at 03:04 PM
Did you checked the UI scale mode of your Canvas Scaler component? Or have you correctly set the ratio you want to in the player settings?
Answer by V0odo0 · Aug 03, 2021 at 06:51 PM
You can achieve this by changing Viewport Rect property of Camera but you'll need to calculate it yourself based on desired and current screen aspect ratio.
Your answer
Follow this Question
Related Questions
Camera viewport should be square and pixel-perfect, regardless of player aspect ratio. 0 Answers
Screen Space - Camera to Screen Space - Overlay switch issue 0 Answers
How do i place borders and sprites on camera edges? 0 Answers
WebCamTexture, get correct resolution and RATIO. 5 Answers
newbe scaling maze sceen for different resolutions 0 Answers