We are in the middle of porting a mobile title to the web for a client and have tried to use WebGL to get the game to run in Chrome. We can run the game but experience a large lag spike when gameplay starts. It seems to be slightly related to providing input to the game, maybe triggering physics and collision calculations or playing back audio from collisions but we have also seen it when the game is just running on its own. I have also tried to build the game both with Unity 5.0.1 and 5.1.1 to see if that would make a difference but it did not have an impact. There is a good chance the problem is caused by an exception being thrown since we can’t get the build to run if we don’t have exceptions enabled.
We also get a JavaScript error alert when reloading the page. I have uploaded a screenshot of that.
These bugs only happen in Chrome. On Firefox the game runs perfectly but of course it’s Chrome we want to support with WebGL.
Since it is client work I can’t share that much more here but if someone from Unity wouldn’t mind taking a look we can send you a copy of the project.
I also get a lot of stuttering right at the start of my projects… Not sure about the exceptions issue you’re running into, but part of it may be related to decompression or parsing. Does the stuttering occur when using the Release (not Compressed) folder built with Optimization level Slow (fast builds)?
The error screenshot does suggest something related to input too as you said, with registerMouseEventCallback…
I can’t get it to connect to the player (with autoconnect enabled in build settings) and we don’t have that lag spike on editor/webplayer/standalone/mobile builds.
Oh hey Marco first realised it was you now No I don’t get anything in the browser console even with full exceptions enabled.
So jeah just to reiterate we can only get the build to run when we do a slow optimized build, exceptions are enabled and we then have stuttering without any exceptions.
Hey Alexander…so regarding the profiler I would suggest you give it a try with an empty project. For the exception, would you be able to reproduce the problem with a small project so that we could look at it ?