[Help!] Problem when exporting the game

I have finished the project, however when I try to export I get an issue with the screen resolution. As you can see in Unity its all good

but after exporting the resolution changes to screen2 . I’ve been at it trying to figure it out and I feel like the solution is so simple, but I can’t manage to figure it out just yet :frowning:

Hi,

It might look ok in Unity, but if you notice, you have a scale of 0.625, so you have artificially made it fit so to speak.

What type of build is the latter? Stand alone or WebGL?

I tried both standAlone and WebGL and on both the same problem persists. I don’t believe I have deviated from the course in anyway.

Hi Timur,

When you run the stand alone build, did you select a screen resolution from the options which are presented in the small window that matched those you have specified in your game? When you tried WebGL, did you click the full screen option?

What do you have specified in the WebGL build settings for the resolution? For example;

image

Do your values match those which you have set for the Game view?

I did try to match those however I didn’t find 1440x1080 in the list. There is only 1440x900. I did click the full screen option and the same problem persisted. The screenshot you sent - I am not sure where you found those settings. When I click “Build Settings” and select WebGL I dont get presented with those options.

Hi,

Click on the Player Settings button within the Build Settings window;

Within the Inspector on the right-hand side (depending on your layout) you will then see the various sections, expand the one named “Resolution and Presentation”

I did find that setting and changed it to 1440x1080 and thought it would solve the problem. However it made it even worse, zooming even closer :confused: I am so confused

Hi Timur,

Can you zip up your project files and share them with me so I can take a look please.

Also, what is the target resolution you actually want?

The forum will allow uploads of up to 10MB, if your project files (zipped) are larger than that you would need to use a service such as Google Drive or Dropbox, and then share the URL.

FutBalled1.zip (7.3 MB)
This is the latest WebGL build. Keep in mind that it is set to play with itself automatically at a high speed. My target is to get it to 4:3 aspect ratio. Which I believe is 1440x1080. Thanks a ton for your help!

Hi,

No, I mean your project files, e.g. so I can open your project in Unity and look at whatever the problem is.

Hope I’ve done it right this time :confused:
https://drive.google.com/file/d/17OcPnARfPGZOarH1eG6dE3w1eaReVjy4/view?usp=sharing

It’s no problem :slight_smile:

Downloading it now.

Sorry for the delay, the first build always takes ages.

In the game view I changed aspect ratio to 4:3, as I had a fixed screen size set of 1920x1080. I noted that the scale of significantly reduced because of the 2 window layout. I ran the game and with the Maximise on Play option set everything looked ok. I built the game and ran it via Microsoft Edge locally. Without clicking on the Full Screen option I had to scroll up/down slightly to see the top and bottom (my laptop display resolution is 1600x900). I then clicked on the Full Screen button and the display changed so that your game filled the screen from top to bottom, on either side (left and right) there were some yellow borders.

I set the build settings to a resolution of 960x720 (also a 4:3 ratio) and built the game again. I launched the game again via Microsoft Edge. This time the main menu and game scene filled the desired size. I checked your background image which is 1440x1080 pixels.

The reason for the yellows bars when I run the game at the 1440x1080 screen size is because my laptop display height is less than 1080, it’s 180 pixels less tall. 1080/180 = 6, with an aspect ratio of 4:3, (6/3) * 4 = 240. Thus I would expect 240 pixels to be deducted from the desired 1440 pixel width, leaving your games width to be 1200. (1200x900 = 4:3).

Here’s a screenshot confirming the above;

Now, lets take your setup into account. What is the display resolution on your computer?

My display is 2880 x 1800

Ok, so, if you set the Game view aspect ratio to 4:3 in the drop down and set the WebGL build properties to 1440x1080, build the game and then rather than uploading the build to a platform like ShareMyGame, just open the index.htm, how does it look?

Note, Chrome prevents WebGL from being displayed for security reasons, Micrsoft Edge doesn’t but I guess this isn’t going to be an option for you.

If that doesn’t work, try giving itch.io a go, you’ll need to register but you can then upload you WebGL game there. Itch.io has more options/customisation than ShareMyGame.com, on the latter, the iframe that is used to house the game is set to a specific size, if you exceed this you’ll get scroll bars, if you maximise the screen you’ll be back to the issue I described above where you’ll get as much height as can fit the screen, but then, as you have a 16:10 display, you’ll get the width with some borders.

I’m surprised as separate stand along build gives you any problems though? Did you see the little window that your build game launches at the beginning which asks you to specify a screen size? Make sure you selected Windowed as well as specifying the size.

Privacy & Terms