Grab your Unity assets at discounts!
How to Create & Load JSON Files Using Addressables in Unity
In this tutorial, you will learn how to dynamically load and manage JSON files in Unity using Addressables. We will use local Addressables, ensuring that the JSON file is included in the game build while still benefiting from Unity’s optimized asset loading system.
Indie Impulse
2/6/20254 min read
Managing game data efficiently is crucial for performance and flexibility. Unity’s Addressable Assets System allows you to dynamically load and manage JSON files.
This tutorial will teach you how to:
✅ Install Addressables properly in Unity.
✅ Manually create a JSON file
✅ Add JSON to Addressables & set an Addressable Key.
✅ Load and parse JSON in Unity using a C# script.
✅ Build Addressables to package and optimize assets.
✅ Display all JSON properties dynamically.
Manually Create a JSON File
Before Unity can load a JSON file, you need to create one manually in your project folder.
✅ How to Create a JSON File
1️⃣ Open Windows Explorer.
2️⃣ Navigate to your Unity project's Assets folder.
3️⃣ Inside Assets, create a new folder:
📂 Assets/GameData
4️⃣ Right-click inside the JSON folder → New > Text Document.
5️⃣ Rename it to GameData.json (Make sure it's .json, not .txt).
6️⃣ Open GameData.json with Notepad or Visual Studio).




7️⃣ Paste the following JSON content:
✅ Create a New C# Script
1️⃣ In Unity, go to Assets > Create > C# Script.
2️⃣ Name it "JSONLoader".
3️⃣ Open it and replace the content with:


✅ How to Build Addressables
1️⃣ Open Window > Asset Management > Addressables > Groups.
2️⃣ Click Build > New Build > Default Build Script.
📌 Why? This packages GameData.json into the Addressables system so it can be loaded at runtime.


✅ Make JSON an Addressable Asset & Assign a Key
Unity does not automatically detect assets as Addressables, so you need to manually mark your JSON file as Addressable, assign it a key, and add a label.
How to Add JSON to Addressables
1️⃣ Open Unity and go to Window > Asset Management > Addressables > Groups.
2️⃣ Drag and drop GameData.json into the Default Local Group (or any custom group).


3️⃣ Under the Label column, click the dropdown menu.
4️⃣ Click the settings icon (⚙️) next to the dropdown.
5️⃣ Click the + button to create a new label (e.g., GameData).
6️⃣ Click Save and select the saved label in the Group window.




Install Addressables in Unity
Before using Addressables, you need to install the Addressables package in your Unity project.
✅ How to Install Addressables
1️⃣ Open Unity Editor.
2️⃣ Go to Window > Package Manager.
3️⃣ Select Unity Registry from the top-left dropdown.
4️⃣ Search for Addressables.
5️⃣ Click Install (or Update if it's outdated).
🔹 Recommended Addressables Version: Use v1.19+ for best performance.






✅ Attach the Script to a GameObject
1️⃣ In Unity, create an empty GameObject (GameObject > Create Empty).
2️⃣ Rename it DataLoader.
3️⃣ Attach the JSONLoader.cs script to it.
4️⃣ Press Play to test.
✅ Your JSON is now dynamically loaded in Unity!








📌Local Addressables (Stored in Build)
✅ Used for assets that won’t change after the game is built.
✅ The game loads assets from the device storage instead of Unity’s default Resources folder.
✅ Assets are packaged separately but still included in the build.
When to use?
✔ If you want to manage memory better and load assets only when needed.
✔ If you want faster scene loading by keeping assets separate.
Does it allow updates after building? ❌ No. Since assets are inside the build, you must rebuild the game to update them.
📌Remote Addressables (Updated After Build)
✅ Used for assets that need to be updated after the game is built.
✅ Assets are stored on a server (CDN, AWS, Google Drive, Firebase, etc.).
✅ The game downloads the latest version when needed.
When to use?
✔ If you want to update content remotely without rebuilding the game.
✔ If you want to reduce game size by downloading assets only when needed.
✔ If you want to add new content dynamically (e.g., new levels, characters, JSON files).
Does it allow updates after building? ✅ Yes. You can update the JSON or any other asset without rebuilding the game.
✅ We Will Use Local Addressables in This Tutorial