Tuesday, September 1, 2026

How to Use Unity Addressables: Fix Build Size, Memory, and Asset Loading for Beginners

There is a specific moment in most Unity projects when asset management stops working. You have been using the Resources folder since day one because it is simple — put a prefab in Resources, call Resources.Load, done. Then you add a few hundred assets, your build size balloons, your load times get worse, and you start noticing that Unity loads everything in Resources at startup whether the current scene needs it or not.

That is when most developers search for "Unity Addressables" for the first time.

Addressables is Unity's answer to the Resources folder problem. It provides a way to load assets by a string address — like a key — rather than a direct reference, supports asynchronous loading from any location, and handles dependency management and memory counting automatically. The setup is more involved than Resources.Load, but the tradeoff is real control over what is in memory, when it loads, and where it comes from.

This guide covers the full beginner path: installing the package, marking assets as addressable, loading them in code, releasing memory correctly, and understanding Groups well enough to make sensible decisions about your project's asset structure.



Resources Folder vs Addressables: The Real Difference

Before touching any Addressables setup, understanding why the Resources folder falls apart at scale saves you from second-guessing the switch later.

When you put an asset in a Resources folder, Unity includes it in the build unconditionally. Every texture, prefab, and audio clip in Resources gets packed into the game regardless of whether a player ever reaches the content that uses it. On mobile especially, this punishes your build size and your startup memory without any benefit to players who never trigger those assets.

Addressables loads assets on demand. Only the assets your code explicitly requests get loaded, and only when they are requested. Assets can live locally in the build, or remotely on a server, and the loading code is identical either way. That last part is what makes Addressables worth the setup cost for projects planning any kind of content delivery beyond the initial install.

Area Resources Folder Addressables
Asset loading Synchronous, blocks main thread Asynchronous, non-blocking
Build inclusion Everything in Resources, always Only what is explicitly loaded
Memory management Manual, easy to leak Reference counted, explicit release
Remote content Not supported Built-in, same code as local
Setup complexity None — just put files in folder Moderate — package install + Groups config
Best for Small projects, prototypes, jam games Any project targeting mobile or planning DLC

The Resources folder is not wrong for small projects. If you are making a game jam entry or a quick prototype with fifty assets, Addressables adds overhead you do not need. The switch makes sense when build size starts to matter, when you want scene-by-scene memory control, or when you are planning post-launch content updates.


Part 1: Installing the Addressables Package

  1. In Unity, go to Window > Package Manager.
  2. In the dropdown at the top left, select Unity Registry.
  3. Search for Addressables.
  4. Select Addressables from the results and click Install.

After installation, go to Window > Asset Management > Addressables > Groups. Unity prompts you to create the Addressables settings — click Create Addressables Settings. This generates a set of configuration assets in your project under Assets/AddressableAssetsData/. You do not need to edit these files directly — the Groups window is where all configuration happens.

The Groups window is the Addressables control panel. Every asset you mark as Addressable appears here, organized into groups. Groups control how assets are bundled for the build and where they are loaded from.

Part 2: Marking Assets as Addressable

Any asset in Unity — prefab, texture, audio clip, scene, ScriptableObject — can be made Addressable.

Method 1: Inspector Checkbox

  1. Select any asset in the Project window.
  2. In the Inspector, check the Addressable checkbox that now appears after the package is installed.
  3. An address field appears below the checkbox, pre-filled with the asset's path. You can leave this as-is or replace it with a shorter, more meaningful address like "PlayerPrefab" or "Enemies/Goblin".

Method 2: Drag Into Groups Window

  1. Open the Groups window (Window > Asset Management > Addressables > Groups).
  2. Drag assets from the Project window directly into a group in the Groups window.

Both methods do the same thing. The Inspector checkbox is faster for individual assets. Drag-and-drop is better for marking many assets at once or for organizing assets into specific groups during initial setup.

Choosing Addresses

The address is a string you use in code to request the asset. The default (the asset's full project path) works but is fragile — if you move or rename the asset, the path changes and your code breaks. A custom address like "UI/HealthBar" or "Characters/Orc_Warrior" decouples the code from the file system location. Moving the asset later only requires updating the address in the Inspector, not in every script that references it.

Labels are another organizational tool. A label is a tag you apply to multiple assets — "Enemy", "Level1", "AudioMusic" — and you can load all assets with a specific label at once rather than loading each by individual address. Labels become useful when you want to load an entire category of assets, like all enemies for a specific chapter.



Part 3: Loading Addressable Assets in Code

This is where Addressables requires a different approach from Resources.Load. Addressables uses asynchronous loading — you request an asset and get back a handle that completes when the asset is ready. You cannot use the loaded asset on the line immediately after you request it the way you can with synchronous Resources.Load.

Loading a Prefab and Instantiating It

using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;

public class EnemySpawner : MonoBehaviour
{
    [SerializeField] private string enemyAddress = "Characters/Orc_Warrior";

    private AsyncOperationHandle<GameObject> _handle;

    public void SpawnEnemy(Vector3 position)
    {
        Addressables.LoadAssetAsync<GameObject>(enemyAddress).Completed += OnEnemyLoaded;
    }

    private void OnEnemyLoaded(AsyncOperationHandle<GameObject> handle)
    {
        _handle = handle;

        if (handle.Status == AsyncOperationStatus.Succeeded)
        {
            Instantiate(handle.Result, transform.position, Quaternion.identity);
        }
        else
        {
            Debug.LogError($"Failed to load enemy: {enemyAddress}");
        }
    }

    private void OnDestroy()
    {
        if (_handle.IsValid())
            Addressables.Release(_handle);
    }
}

Three things worth understanding in this code before moving on.

.Completed += registers a callback that fires when the async operation finishes. You can alternatively use async/await with Addressables if you are comfortable with C# async patterns — either approach works, the callback version is shown here because it does not require additional setup.

handle.Status == AsyncOperationStatus.Succeeded is the error check. Addressables loads can fail — wrong address string, missing bundle, network error on remote assets. Always check the status before using the result.

Addressables.Release(_handle) in OnDestroy is not optional. Addressables counts references automatically and unloads assets when the count reaches zero — but only if you call Release. Forgetting Release is the most common Addressables memory leak. The asset stays in memory permanently until the application quits.

Instantiate and Release Together

For prefabs that you want to instantiate once and never reuse, there is a shortcut:

Addressables.InstantiateAsync(enemyAddress, position, Quaternion.identity).Completed += handle =>
{
    if (handle.Status == AsyncOperationStatus.Succeeded)
    {
        // The instance is already in the scene
        // Release is handled automatically when the GameObject is destroyed
        // IF you use Addressables.ReleaseInstance instead of Destroy
    }
};

When using InstantiateAsync, call Addressables.ReleaseInstance(gameObject) instead of Destroy to properly decrement the reference count. Calling regular Destroy on an Addressables-instantiated object destroys the GameObject but does not release the underlying asset from memory.

Part 4: Understanding Groups

Groups determine how Addressable assets are bundled together for the build. Getting Groups wrong does not break anything immediately — it degrades performance and build size over time in ways that are hard to diagnose later.

Default Local Group

The default group Unity creates is fine for getting started. Assets in this group are packed into the build and loaded from local storage. For a project that does not need remote content or DLC, one well-organized local group covers most needs.

One Asset Per Bundle vs Pack Together

In each group's settings, the Bundle Mode controls how assets within the group get packed:

  • Pack Together — all assets in the group go into one bundle file. Loading any asset from the group loads the entire bundle into memory. Good for assets that are almost always used together (all assets for a specific level, all UI sprites).
  • Pack Separately — each asset gets its own bundle. Fine-grained memory control, but more bundle files and more overhead per load request. Good for large assets you load infrequently.
  • Pack Together by Label — assets sharing a label get bundled together. The most flexible option for projects with meaningful label organization.

The Pack Together trap: if you put all your game's assets in one group set to Pack Together, loading a single enemy prefab loads the entire bundle — potentially hundreds of assets — into memory at once. This defeats the purpose of Addressables. Organize groups by when assets are used, not by asset type.


Part 5: Building and Testing

Building Addressable Content

Before testing Addressables in a build, you need to build the Addressable content separately from the main Unity build:

  1. Open the Groups window.
  2. Click Build > New Build > Default Build Script.
  3. Wait for the build to complete. Unity generates bundle files in your project's Library folder for local groups.

After building content, build the player as normal. The Addressables bundles are included automatically.

Testing in the Editor

In the Groups window, the Play Mode Script dropdown controls how Addressables behave in Play Mode:

  • Use Asset Database (fastest) — loads assets directly from the project without going through bundles. Fastest iteration but does not test actual bundle loading behavior.
  • Simulate Groups (advanced) — simulates bundle loading without building bundles. Slower than Asset Database but catches dependency and grouping issues without a full build.
  • Use Existing Build (requires built groups) — tests exactly what will happen in a real build. Requires the Addressable content build to be up to date.

Use Asset Database during active development. Switch to Use Existing Build when testing a release candidate to confirm the actual bundle loading behavior matches what you expect.

Common Mistakes

  • Forgetting Addressables.Release after loading. This is the source of most Addressables memory leaks. Every LoadAssetAsync call needs a corresponding Release when the asset is no longer needed. Store the handle and release it in OnDestroy or when the asset's lifetime ends.
  • Using regular Destroy on Addressables-instantiated objects. Destroy removes the GameObject but does not release the asset from Addressables' reference count. Use Addressables.ReleaseInstance(gameObject) instead.
  • Putting all assets in one Pack Together group. Loading any single asset from a Pack Together group loads the entire bundle. One massive group effectively re-creates the Resources folder problem — everything in memory, all at once.
  • Not rebuilding Addressable content after changing assets. If you mark new assets as Addressable or change group settings after the last content build, the bundles are stale. Always rebuild content before testing with Use Existing Build play mode.
  • Using the full asset path as the address and then moving the file. If the address is the file path and you reorganize your project folder, the address changes and any code referencing the old path breaks silently at runtime. Custom addresses decouple code from file location.
  • Mixing Addressables and Resources.Load for the same asset. If an asset is marked as Addressable and also sits in a Resources folder, Unity may include it twice in the build — once in the Resources bundle and once in the Addressables bundle. Remove assets from Resources when you mark them as Addressable.

Action Steps

  1. Install the Addressables package through Package Manager and create the initial settings file.
  2. Identify three to five assets in your current project that are loaded at runtime — enemy prefabs, UI elements, audio clips — and mark them as Addressable with meaningful custom addresses.
  3. Replace any Resources.Load calls for those assets with Addressables.LoadAssetAsync, add the Completed callback, and add Release in OnDestroy.
  4. Organize those assets into groups based on when they are used — not by asset type.
  5. Run a content build and test with Use Existing Build play mode to confirm loading works as expected.

Next Topics To Learn

  • Unity Scene Management Explained — Addressables handles scene loading too. Addressables.LoadSceneAsync replaces SceneManager.LoadScene for scenes you want to load on demand from bundles.
  • Unity Mobile Optimization Guide — build size reduction, memory management, and texture compression decisions connect directly to how Addressables groups are organized for mobile targets.
  • Unity Save System Guide — ScriptableObject-based save data pairs well with Addressables when save state needs to reference assets by address rather than by direct reference.

No comments:

Post a Comment

How to Use Suno AI for Game Development: Generate a Full Game Soundtrack Without Knowing Music Theory

 Game music is the thing most indie developers either ignore or handle badly. A looping royalty-free track from a free asset site. The same ...