How to make a chunk system in Unity using addressables
If you played to Minecraft you already know what chunks are but for the most unfortunate I’ll give you the Minecraft Gamepedia definition:
Chunks are the method used by the world generator to divide maps into manageable pieces.
Don’t worry, it’s not a Minecraft specific tutorial explanation, the comparisons stop here.
Before we start, I’m using Unity version 2020.3.5f1 with the addressables package version 1.16.16, all the 3D assets are made by Kenney.
1. Preparation
If it’s not already the case you need to install the addressables package via the package manager.
Once you have everything in place and you have created your level design, you need to convert every piece into a prefab, the size and what you define as pieces depends on your needs.
For example, this is what my demo scene looks like and every hexagon tile has been converted into prefabs:
When it’s done, you need to select all your prefabs freshly created inside the Project view and click on the Addressable checkbox in the top left corner of your Inspector view.