Build a PWA with Unity?

Hello guys !

I’d like to create a PWA game, I suppose webGL is the place to start investigating but how to actually build a PWA ?

Thanks a lot for any pointer !

PWA is just a fancy term for “this website content runs on multiple platforms and can be live updated”. :wink:

By nature of Unity WebGL being cross-platform and with Unity 6 also officially supported on mobile devices, any WebGL build created with Unity almost meets the definition of PWA (progressive web app).

The only thing is the “progressive” part because to achieve that, you would have to use Addressables to be able to load or replace content after the application was loaded. But the same is true for any PWA - if it’s not built to support progressive updates it really isn’t progressive.

Anything that would possibly change needs to be programmed in a way that it can be updated at runtime. Unity Cloud Services can be used for this purpose where you merely need to change settings, Remote Config for instance.

If anything requires updating the client build itself the client has to support a reload feature, most easily by telling the browser to reload the page or the Unity content frame. Although reloading the application isn’t perfectly “progressive” many web apps still have to do so in order to apply updates. Of course this must be done at the user’s discretion (ask!) and without losing any data.

3 Likes

Unity also gives you a helping hand with a template to publish it

9880890--1425384--upload_2024-6-9_11-51-52.png

2 Likes

Very well said and interesting point on terminology. Building PWA is basically default settings now with Unity 6 with quite literally zero effort from user. Everyone and anyone can now click one button and have a beautiful mobile responsive build with all the optimizations one could desire on web. Amazing but also scary how easy it is now.

Yes, but this is infinitely more progressive than our current reality of totalitarian app store monopolies that make you wait days/weeks for a biased human to manually approve your game :smile:

Of course, apple finally “supporting” is very optimistic and great, but I can’t imagine why a company with an infinite cash cow store + total control of their user’s devices would willingly go out of their way to continue develop / support / promote PWAs? They already nerfed pwas in EU, and they reluctantly released pop up notifications in a completely broken and botched state, perhaps intentionally… I mean at what point do they just halt their current accessibility on all devices? I genuinely can only name like 5 successful pwas that I use or have heard of, but then you look at countries like China / Russia that have hundreds of millions of daily PWA users and it doesn’t become so clear anymore.

On a side note, if pwa support continues to “flourish”, it becomes so glaringly obvious that web will be the peak and final platform of choice for ALL unity games / apps. Every game and app will be rendered on web, powered by the obvious titan’s GPUs and AI blah blah technology. How long until we start seeing nvidia + unity + webgpu + pwa + ai or any combination of those buzzwords in every single article and youtube thumbnail? I imagine unity has the analytics and info on pwas and it’s probably very very very juicy data. Or they are just gambling on this tech being the future (which it will be).

3 Likes

Thank you guys, very good replies :slight_smile:

And sorry for the long delay here ^^