Skip to content

Unity web optimization

Unity WebGL is perfectly capable of shipping instant-feeling games, but not out of the box. Most of the work is in trimming the runtime and deferring asset loading so the first thing a player sees shows up fast.

Target: ~8 MB initial download (≈ 7 MB runtime + ≈ 1 MB of “first scene” assets). Everything else arrives as Addressables after the loading screen is visible.

Unity 6.1 brings the web optimisations the FRVR wrapper assumes. Upgrade first — how much work it is depends on how far back you’re coming from, but from a recent version it’s usually close to free.

Install Unity’s Web Stripping Tool Package and trim aggressively. Ballpark runtime sizes:

BuildApprox. runtime
Unstripped~12 MB
”Empty” (default stripped)~5 MB
”Minimal” (tool‑stripped)~7 MB

The minimal profile is usually the right target — it keeps enough of Unity for real games without paying for 5 MB of unused subsystems.

3. Structure the game for progressive loading

Section titled “3. Structure the game for progressive loading”

Three patterns, ordered from worst to best:

Everything in a single download. The player sees nothing until the whole game is loaded. Drop‑off is huge — especially on mobile web.

  1. The initial scene is tiny: just a progress bar and optionally your game title.
  2. The moment that scene is up, start pulling the rest of the game as Addressables.
  3. Swap into the real scene when the needed Addressables finish.

Same pattern, but the loader chooses which Addressables to pull based on the player. New users get the tutorial bundle; returning users skip it and get the “home screen” bundle instead. Gets time‑to‑play down further for your hottest cohort.

  • Compression format: Brotli, fallback enabled.
  • Template: Default Unity WebGL template (FRVR’s pipeline rewrites it).
  • Run in background: OFF.
  • Unity version: 6.1+.

Not strictly a performance tip, but it belongs here because it’s the first thing that breaks iOS playback:

  • Load Type: Decompress on Load.
  • Compression Format: AAC (or PCM where AAC isn’t viable).

Apply to every AudioClip. One missed clip is enough to trip Facebook’s iOS mute‑compliance check.

  • Unity 6.1+
  • Web Stripping Tool Package applied
  • Loading scene pattern (progressive Addressables) in place
  • Initial download ≤ ~8 MB
  • Brotli compression + fallback
  • “Run in background” disabled
  • Every AudioClip: Decompress on Load + AAC/PCM