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.
1. Get on Unity 6.1+
Section titled “1. Get on Unity 6.1+”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.
2. Shrink the runtime
Section titled “2. Shrink the runtime”Install Unity’s Web Stripping Tool Package and trim aggressively. Ballpark runtime sizes:
| Build | Approx. 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:
❌ One monolithic bundle
Section titled “❌ One monolithic bundle”Everything in a single download. The player sees nothing until the whole game is loaded. Drop‑off is huge — especially on mobile web.
✅ Simple loading scene → Addressables
Section titled “✅ Simple loading scene → Addressables”- The initial scene is tiny: just a progress bar and optionally your game title.
- The moment that scene is up, start pulling the rest of the game as Addressables.
- Swap into the real scene when the needed Addressables finish.
✅✅ Conditional Addressable loading
Section titled “✅✅ Conditional Addressable loading”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.
4. Build settings (reminder from the quickstart)
Section titled “4. Build settings (reminder from the quickstart)”- Compression format: Brotli, fallback enabled.
- Template: Default Unity WebGL template (FRVR’s pipeline rewrites it).
- Run in background: OFF.
- Unity version: 6.1+.
5. Audio imports
Section titled “5. Audio imports”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.
Checklist
Section titled “Checklist”- 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