How to change the screen size of WebGL

When I created my game in Unity, I chose the resolution of 1080 * 1920. It looks like this

When I build the file of WebGL, I also changed the resolution size in player settings. But when it comes to web, the game became something like this:

Could anyone tell me what to do to make the screen size on web be exactly like what I made in Unity?

Add a aspect ratio fitter component to your UI.
And if you can't resize the window, you can change the canvas size in the player settings.


Thanks! I tried, but it didn’t work

In case you haven't found an answer to this, you need to go to Edit > Project Settings > On the WebGL settings, change the default canvas width and height based on your ratio/screen size:


I have a similar issue. When I build the game it comes out super zoomed in. Not sure how to fix this, any suggestions?

1 Like

Change the Canvas Size to 1920x 1080 and use these modes Default one, To reflect it Delete the Browser Histroy and then try again using default. Browser catche save the resolutions.