I am making a 2d game in unity and when I set the aspect ratio to 16:9 it shows letterboxes on the side. THe variables of my camera:
Size:12
Viewport Rect:
x:0
y:0
W:8
H:4.5
I am making a 2d game in unity and when I set the aspect ratio to 16:9 it shows letterboxes on the side. THe variables of my camera:
Size:12
Viewport Rect:
x:0
y:0
W:8
H:4.5
You’re seeing those letterboxes in the editor, yes? Do you see them in a built player?
The editor is a bit of a special case: there are a lot of windows open, and there’s no guarantee that whatever area you’ve set aside for the game viewport is neat, clean, or large. So you will probably see some letterboxing if you specify an aspect ratio – that’s how it gets your game to fit in the viewing area that you provided.
Unless you see it in the built player, this sounds like it’s working as intended.
Use two cameras, one for the background and one with a properly computed viewport rect, such as: http://wiki.unity3d.com/index.php?title=AspectRatioEnforcer
I set the default aspect ratio to 1366 x 768 in the player settings. Build settings > player settings.