For convenience, I want my game to always render at 16:9 (1.778 aspect ratio). I set the camera settings, set the menu settings, set the canvas settings, but for some reason the UI of every menu still expands over the whole screen instead of being contained within the 1.778 aspect ratio.
this happens:
here's my:
I also noticed that in the windows build, even when the UI buttons are completely outside the visible area, they're weirdly still clickable
any idea what I'm missing?
I'm with unity 2021.2.14, AC 1.81.6
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
When Unity UI is used for Menu rendering, they won't - by default - be aware of the game's aspect ratio, which is different to that of the screen/window.
Fixing this is a case of using the Auto-correct UI dimensions component to have it scale / reposition itself properly.
See the Manual chapter by the same name for details, but AC's default UI prefabs also make use of this - you can check to see how they get used as well.