One of the main issues with WebGL games seems to be caused by the site loading the game in an iframe. If you're having problems and this page doesn't help you, first load the game with your browser's developer console open and check if there are any errors. Then, try searching for keywords related to the issue you're having + iframe (e.g. "unity3d webgl keyboard focus iframe") or search for any non-obvious errors you see in the console.
We will continue to add issues and any workarounds or fixes we find here. If you've done some search and still haven't resolved the issue you're having, feel free to post a question in the Unity3D WebGL Support thread
Please be sure to do the above basic troubleshooting first!
How to publish your game on NG
With Google's recent deprecation of NPAPI plugins, the WebGL export option in Unity 5 has become the only option for game developers to publish web based Unity games to Chrome users.
Unfortunately, this transition to WebGL has not been the easiest for many developers, and publishers like Newgrounds have had to make various changes to their server configurations to even support the way Unity has gone about implementing things.
Here is some introductory information on how to publish your WebGL unity games here on Newgrounds.
When you are ready, build your game. Make sure you are not doing a development build.
Once your game is built, you will have the following items in whatever folder you built to:
- Compressed <dir>
- Release <dir>
- TemplateData <dir>
You will need to select the following items and add them to a zip file:
Release, TemplateData and index.html
The Release folder contains all your core game files. TemplateData contains your basic loader and css assets, and index.html is the file that loads all these others into the browser.
Once your zip file is ready, simply go to your game project and upload it.
You may be asking, why don't we use the .htaccess file and the Compressed folder. The short answer is security.
An .htaccess file essentially lets a directory override certain settings from the web server. In this case, it is used to tell your game to use the compressed version of your game instead of the release version. Unfortunately, we can not allow the general public to use .htaccess files because they could be used maliciously.
The good news is our servers will automatically compress your files when users load them. So if your release folder is actually around 100mb, the end user will only download 20mb or so.
Because you are putting your game in a zip file, your uploads will also be compressed, so you won't be waiting for 100+mb of data (unless your game is THAT huge compressed).
Including the .htaccess file and Compressed folder in your zip won't really hurt anything, but it will add the size of your compressed files to your upload and essentially double your wait time.