Game view aspect ratio not the same as in build?

Hi,

in my game view in the editor I can set my aspect to 16:9. When I now change the width height of the game view, my UI and all changes to display a 16:9 view of the game. The UI scales just fine with the changes and letterboxes are visible to block the parts outside the 16:9 view.
When I build the game and now change the size of the window my UI Elements behave completely different and don’t scale the same anymore. There are no letterboxes either.

Is there a way to have the build behave the same as the game view in the editor.

Thanks

Alex

  1. depending on which UI solution you’re using:
  • uGUI → go to the “Canvas”, there should be a Canvas Scaler, Set to “Scale With Screen Size” give it a 16:9 Reference Resolution
  • UIToolkit → go to the UIToolkit Panel Settings, Adjust the Scale mode as described for the Canvas Scaler above.

In earlier unity versions you could selected “supported aspect ratios” in the Project Settings > Player > Resolution and Presentation

Thanks, those settings are already done.
The problem seems to be that the editor allows you to restrict the game view to 16:9 whereas the build does not allow that (any more?) and runs in “free aspect”. Hence the different behavior.

As I read in another thread unity does not help with a fixed aspect ratio and letterboxing anymore in the build and I have to care about it myself.