WebGL build not working on web

To test Unity 5’s WebGL export, I used one of the Standard Assets demos (the first-person character demo). It only works either from the Build and Run option directly or if I use my browser to run the file on my own machine (and even then it only works in Firefox and maybe a few others); but when I upload it to a webpage I just get either a gray screen or the Unity logo with a green loading bar which never advances.
Is this another case of needing to have everything in the Resources directory, or what am I doing wrong?

Are you uploading the compressed or uncompressed files? What kind of server is it? Do you have mime types specified for the .mem and .data files?

I’m uploading the entire directory produced by the build process, including both the compressed and decompressed file folders. It’s a cheap account with 1&1.com. I don’t know whether mime types are specified. But it does work when uploaded to DropBox, but seemingly only if the account holder has either a paid account or an older account with a public files area (I asked someone else to upload it to theirs, since the shared link wasn’t working with my account).

That’s likely your problem. Open your browsers developer tools (or firebug) and see if those files are downloading, see what mime type they’re coming back as, and drill into the response to see if what’s actually being returned is what’s supposed to be. I bet the mime types aren’t defined and its not going to work without them.

1 Like