> For the complete documentation index, see [llms.txt](https://wiki.playgama.com/playgama/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.playgama.com/playgama/guides/performance-and-optimization/unity/unused-packages.md).

# Unused packages

* Remove the New Input System if it is not used
* Clean Quality and Graphics settings
* Delete unused Unity packages

Unused Unity packages can add several megabytes to a WebGL build even when the game does not use them.

**What to check first**

* Remove the New Input System if your game uses only the old Input Manager. This package alone adds around 2.4 MB.
* Delete packages that were added by default but not used:
  * Visual Scripting
  * XR / AR modules
  * Analytics / Ads packages if not integrated
* If you use Cinemachine only for simple cameras, consider removing it and using a lighter setup.
* Clean Quality and Graphics settings. Built-in features such as shadows can pull extra shaders into the build.

**How to do**

* Open Package Manager and remove everything not required by gameplay.
* After removal, rebuild and test input, UI, and core mechanics.

**Example**

The example below uses an empty Unity project to show how each setting affects final WebGL build size.

**Step 1:** Create an Empty Unity project for WebGL (we will use Unity 6000.0.23f1 + Built-In Render Pipeline)<br>

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2Fw5YzT3IjHoXpavMgw55o%2Funknown.png?alt=media&amp;token=2bed9629-1e89-4786-b71d-85343305cd37" alt=""><figcaption></figcaption></figure>

**Step 2:** Switch platform to WebGL and make a build to check the default size

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2FmKMJ2tTgW1oAubENtQX9%2Funknown.png?alt=media&amp;token=78af57cf-99c2-4b42-ba2a-e4712b268b09" alt=""><figcaption></figcaption></figure>

The initial build is around 9.7 MB, which is too large for a minimal WebGL project.

**Step 3:** First thing to do! Go to build settings and change “Code Optimization: Build Size with LTO”

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2FL3NmeW4VVE4qKA62XDw1%2Funknown.png?alt=media&amp;token=28236524-7296-45e2-945d-8e9eac611d33" alt=""><figcaption></figcaption></figure>

The build size is now 9 MB.

**Step 4:** Go to Player Settings → set Compression: Brotli and enable Name files as hashes

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2FDUfNKWlS0tYOqYZNbhYv%2Funknown.png?alt=media&amp;token=8db0dd6e-7c01-4ee9-8f54-0233cabfa295" alt=""><figcaption></figcaption></figure>

The build is now 6.8 MB, reduced from 9.7 MB. Continue with the next settings.

**Step 5:** Now let’s change IL2CPP Code Generation to “Smaller Builds” and change C++ Compiler Configuration to Master

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2FWWkrovD6T5r12B6ci9P6%2Funknown.png?alt=media&amp;token=c48be51b-d877-447a-851a-7bd98d4c533c" alt=""><figcaption></figcaption></figure>

**Step 6:** Choose texture compression (ASTC / DXT / ETC2).\
Enable Crunch for textures when possible

**Step 7:** Set Color Space: Gamma if the game supports it (≈100 KB saving)

**Step 8:** Set Managed Stripping Level: High.\
Test the game after enabling stripping because it may remove required code.

Also enable texture mipmap stripping

**Step 9:** Remove unused features and packages

* Delete unused Unity packages
* Clean Quality and Graphics settings
* Disable built-in shadows if not required

New Input System adds **\~2.4 MB**.\
If the project does not use it, remove the package to reduce the build to \~2.2 MB.

After these changes, the build is reduced from about **10 MB** to about **2.2 MB**.<br>
