As we approach the 5th month of Unity 5’s official release, I am still working on WebGL integration into websites, something that was assured to be easy…It’s not.
I have just under 10 years experience developing websites so I know a little about it, and WebGL is not the best way of doing this, but with that out of the way, we can get down to the rest of it.
Wordpress Integration Attempts
Attempt 1
The first attempt of many was the assumed simplicity of Wordpress integration, as there were a few articles on the net about WebGL and Wordpress.
This did not go so well.
After attempting to use the embed code directly in a Wordpress page, I quickly came to the conclusion that this was not going to work at all.
The next issue was uploading, I had to strip the security on my dev site all the way back to the bare minimum to allow Wordpress to upload some of the files as they were deemed a “security risk”.
After all what work I was still no closer to finding a solution, but this did not deter me, Edison didn’t succeed the first time round.
Attempt 2
The second of many attempts came from someone’s good idea to use an iFrame, a feature in HTML that allows for “windows” that display content from other URLS (pages).
This did not work either.
As the default files used by the WebGL builds point to the parent folder, not to URLs, I was unable to get a connection.
Other Issues
By now I am sure you are all aware of why the Unity Web Player no longer works in Google Chrome, for those who don’t know, here’s the gist of it:
Google; Who have hated the plugin system NPAPI for a long time (see excerpt quote below), decided to pull support from the main browser at the top of the web market holding over 40% of the worlds internet usage.
Unfortunately, the system the old Unity Web Player used to run it’s plugin was none other than NPAPI, which is why it no longer runs in Google Chrome and will not run for much longer in Internet Explorer or Firefox, so a new system was needed, why WebGL was picked is beyond me.
Straight Integration/Upload
Attempt 1
The first of a new approach after about 10 failed attempts and many weeks wasted was based on the premise that:
This did not go so well either.
The WebGL Unity builds are based on the ability to upload the contents directly to the webspace and use from there.
Using another development area (an empty subdomain pointing to an empty folder), I uploaded a simple demo for testing, after another 4 days wasted, I determined that trying to run these builds how they were intended would not work either, the system these builds were created on would not suit my needs, nor anyone elses in their current condition.
Attempt 2
My final attempt (3 attempts to be precise, spread over just over a week), took me to believe the builds would run on a virtual private network (VPN) running from Visual Studio.
This did work, sort of.
I was able to get past the Unity loading screen so the content was accessible, but when I tried to replicate this on a webspace, things did not go so well.
After it simply not loading, no errors, no javascript complaints, no nothing, I had decided enough was enough, there were 2 choices, come up with a concrete way of getting these builds to at least work the way they are said to work, or give up.
With the second being something I vow never to do in these situations, I am turning to the community and Unity developers for answers.
The Question
The question this little article is building to is:
How Do You Use The Unity WebGL Builds Online?
Why the buildup for such a simple question you may ask? Well, I have spent so much time trying to get this seemingly poorly implemented method working that I do not want to keep wasting time on things that will not work, so I thought it best to mention the methods I have tried so far.
Considering how much time I have spent on this already I think I am remaining very calm considering however I do apologise if this seems threatening or condescending in any way, I’m tired.
Eagerly awaiting replies,
Kyle Briggs.