Hazzaldo
Hazzaldo

Reputation: 563

Unity-WebGL showing grey window instead of interactive website

I have a Unity project, where you can navigate around in a 3D space environment. I'm using Unity version 2020.3.4f1 Personal. I went to 'Build settings', chose WebGL, and then clicked 'Build And Run.

The project seems to launch on a Chrome browser in localhost, without any issues: enter image description here

However, when I zip the build files & folders (index.html file along with the 'Build' and 'StreamingAssets'), then host as a website, all I get is a grey screen, instead of an interactive website! enter image description here

As mentioned the build created is - index.html file, 'Build' folder, and 'StreamingAssets' folder:

enter image description here

Clearly, there's something wrong with the build as the project seems to run fine directly in localhost.

Any help would be really appreciated.

Many thanks

Edit

Looking at the logs in the Chrome browser console (running on localhost), these are the logs: enter image description here

For the 404 error, I found some Unity forum thread: https://forum.unity.com/threads/webgl-builds-only-partially-working.357591/ , where I then thought the solution was to enable Data Caching & Decompression Fallback, and set Compression Format Gzip.

enter image description here

But this didn't solve the issue, as I still get the 404 in the console log, running on localhost (although as mentioned before, in localhost it runs). Also, when hosting it on a server using Netlify it still shows just a Grey window.

Note: strangely when I refresh the browser running localhost, the 404 disappears, but still the main thing is that when hosted on a remote server (Netlify), I just get a Grey window.

Upvotes: 0

Views: 1285

Answers (2)

ElCodes
ElCodes

Reputation: 21

If anyone ever comes across this thread in the future I had the same issues, specifically with Netlify.

I fixed the issue by setting Compression Format to Disabled.

Upvotes: 0

Turbo J
Turbo J

Reputation: 7701

Localhost will be case-insensitive on Windows, while Linux is usually case sensitive on the Host. Check URLs and file names, and try looking at the Web server logs for 404 errors.

Upvotes: 0

Related Questions