Reputation: 1851
I'm developing a game, and in Unity I've set the resolution to 1280x800. When I export to Android, I expect it to adjust to the screen (adding black bars if necessary) but it isn't the case.
This is how it looks like on a Nexus 4:
And on a Nexus 5:
How can I make it so that it looks the same everywhere? (having black bars if necessary as I said before).
Upvotes: 1
Views: 2471
Reputation: 1666
You need to normalize the camera's orthogonal size to a wanted resolution:
camera.orthographicSize = 640/screenwidth * screenheight/2
Upvotes: 2