Saves a few bytes (since the actual code is removed) and works also for older unity version that did not support unchecking those features. So just a minor difference, but both ways are totally fine to do I would say. The Template thing does sound more like the official solution, so I recommend sticking with that.
New build with 2020.1.0f1: WebLoadingTest
My thoughts for the new unity version
-
Build size improved, weâre down to 2.8 MB for this simple project.
-
Build times improved, but compression time for brotli is very high. I would like to see a quality level slider for compression.
-
Needed to change the htaccess file, I didnât manage to get gzip to work correctly, but brotli is more interesting anyways
-
The brotli compressed build does not work with unityâs build&run localhost on firefox. You will need to use Chrome to test your build locally.
-
The new template options are quite nice, I built a simple responsive template without any branding
-
Loading times on older androids are still very long
-
If something breaks in the build on mobile, it is still very hard to debug
For me testing on iOS Safari it doesnât get past the loading bar
Huh, very interesting, thanks for testing. The loading bar will be stuck at 90% for ~4 seconds (at 90% all assets are loaded and the engine initializes).
Did you try to reload the page?
And which device did you use? Runs without problems on my old iPhone SE.
Edit: Do the other versions (2018, 2019) work on your phone?
I didnât, now I have and it loaded second time.
First time I left it for several minutes before I closed it.
Tested on a iPad Pro 10.5 2018 model MQDX2B/A
iOS 13.5.1
Runs lovely now itâs loaded ![]()
If I clear browser data and cache, I basically get the same issue repeating, doesnât load the first time, does load in a new tab. Even though the original tab is still stuckâŚ
2018 and 2019 versions work first time
Would you concider adding a simple camera script?
In my earlier experiments of Nov 2018 it was adding any sort of script that seemed to total break it.
I see, I think I had that problem as well, but dismissed it after reloading. I added that caveat to the readme, not quite sure what the problem isâŚ
Sure, no problem. I added a simple constant rotation to the camera, updated in the same link: https://deml.io/experiments/unity-webgl/2020.1.0f1/
If you want to play around with the project and add your own camera orbit script or something like that, you can just fork it over here: https://github.com/JohannesDeml/UnityWebGL-LoadingTest
Interestingly that new demo is now loading first time for meâŚ
When you are using webgl inside of iframe, safari wont be able to use indexdb, so does it mean, all the assets and other stuff is going directly to CPU?
Having problem, that cpu on iphone 8 goes like 110%+ after simply loading assetbundle with 3d model and ~8 textures (albedo,normals, etc).
Not being able to used IndexedDB means that the browser will not cache any large downloaded files. If your project only consists of relatively small files, generally < 25MB, the browser will cache them into regular browser cache instead of IndexedDB, so that will not be an issue.
I.e. overall the effect will be a bit longer startup time.
Just a quick update with Unity 2020.2.0b11:
Builtin Renderpipeline: https://deml.io/experiments/unity-webgl/2020.2.0b11/
URP: https://deml.io/experiments/unity-webgl/2020.2.0b11-urp/
The filesize of URP is 2.5 MB larger, I guess stripping does not work that well here (maybe the whole post processing stack is included, even though it is not used?).
Other than that, the file size got a little bit smaller compared to 2020.1, and removing the skybox saves another 30 KB. Transition to the new version was very smooth, no problems here ![]()
the 2019.3 version doesnt seem to work with 2019.4 on WebXRViewer ios, do you have anything that works on 2019.4?
@b9n : Didnât work with WebXRViewer so far, but maybe this repo is interesting for you: GitHub - Rufus31415/Simple-WebXR-Unity: â Bringing WebXR to Unity 3D ! B-)
I added an in dom console for easy mobile debugging. It binds itself to the normal console.log functionality while not breaking it, so it can be used in parallel. Might be useful for some
You can try it yourself here

Another functionality I added is an output for the startup time. I will start tracking this in the next unity versions, since the time it takes to load is quite interesting (especially for mobile).
I also tested 2020.3 and 2021.1, not much changes to note compared to earlier unity versions.
Thanks for the debug console javascript, thatâs pretty useful!
on my side is not working, i just test project in unity 2020.3.3
Okay, so from what you sent me the problem is a miss-configuration of your server. Either your server does not support brotli compression, or you didnât use the provided .htaccess file in the repo.

thanks for respond me here fast and also on email, is first time I try this, if can help me to tell me where to place htaccess will be great and also if not compress with brotli my project will be big, so is not fix to work with this?
Take a look at the docs here: https://docs.unity3d.com/Manual/webgl-server-configuration-code-samples.html
For apache servers, place the htaccess file in /Build/.htaccess. For other server technology you will need a different setup (the docs should help there).
As for your other question: Yes, exactly. If you donât compress your build it will be a lot larger and therefore annoying for mobile users.
Hi Johannsky,
Your work is great. Thank you for your efforts.
I tried to publish your project using by âUnity WebGL Publisherâ pakage:

Like above, I clicked âBuild and Publishâ.
But I failed to publish and i got following error:
Is there any good way to publish using by âUnity WebGL publisherâ function?
I want to listen your opinion.
Ah, that is an error Unity introduced in the new beta. Follow the instructions I posted here: https://forum.unity.com/threads/webgl-emscipten-permission-denied-errors.1130176/#post-7278394
Other than that, I didnât know of the publisher package, thanks for pointing it out. ![]()
Edit: Ah, apparently it got fixed in 2021.2.0b7, so upgrading to the latest beta should do the trick as well.
Thank you, Johannski
I followed your solution, and I succeed to âBuild and Publishâ.
Then following link automatically created:
https://play.unity.com/mg/other/webglloadingtest
But i faced to new problem.
If open the link from the desktop, it is stopped in 90% of loading process:

And if I open the link from my iPhoneXR, the screen shows warning:

So I cannot run well from the âBuild and Publishâ.
Do you have any good idea for this problem?
