Resize game according screen resolution

Hello people, did unity resizes the game according the screen resolution?
Like, program in a device with screen 1280x820, but another device has 640x480, did the engine resize the game automactly?

Best regards!

I tried this before as a test for my project, and it does resize the game. However you would have to re-run the game after resizing the screen resolution, anywise positions may move out of place.

But basically yes it does is the simple answer :slight_smile:

EDIT: i only tried it for a 3D game, i haven’t tried it for 2D. I guess for 2D the textures might become pixelated or something unless the textures are changed to match the screen resolution.

Hi,

you can get the supported resolutions from Screen.resolutions

Then just change the app res but using Screen.SetResolution(int width, int height, bool fullscreen, int preferredRefreshRate = 0)

Links:

Screen.resolutions

Screen.SetResolution

Hope this helps.

Hi,
I use this script to do that:

Screen.SetResolution (Screen.currentResolution.width, Screen.currentResolution.height, true);
Screen.fullScreen = true;