A simple, modular inventory system for Unity that works together with a save/load system. It includes a hotbar, a dynamic inventory (backpack, chests, etc.) and ScriptableObject-based items.
🇹🇷 Türkçe dokümantasyon için README.tr.md dosyasına bakın.
- ScriptableObject-based item definitions (easy to create and extend)
- Hotbar with configurable length
- Dynamic inventory UI for backpacks, chests and other containers
- Pick-up component to turn any GameObject into a collectable item
- Save/load integration through Game-Save-Load-System
- Unity (recommended: a recent LTS version)
- Input System package (install via Window > Package Manager)
- TextMeshPro (used for item count text)
- Game-Save-Load-System (only if you want save/load support)
| Folder / File | Description |
|---|---|
Inventory/ |
Core inventory logic, including Inventory Holder |
Iteam/ |
Item data (ScriptableObjects), e.g. InventoryIteamData, EdibleItemData |
UI/ |
Inventory and hotbar UI scripts, e.g. InventorySlot_UI, DynamicInventorySystem, HotbarDisplay |
PickUp.cs |
Makes a GameObject collectable and links it to an item |
- Copy the repository contents into your Unity project's
Assetsfolder. - Install the Input System package from the Package Manager.
- Follow the setup steps below.
The offset value in Inventory Holder defines the length of the player's hotbar.
- Create an empty Canvas object.
- Add as many slot prefabs as you want as children (one per hotbar slot).
- Fill in the empty object's references as shown in the example image below.
private int _maxIndexSize = 3;
private int _currentIndex = 0;The index values must match the offset value you set in Inventory Holder.
Items are used as ScriptableObjects. It is recommended to derive your items from InventoryIteamData.
- In the Project window, right-click and open the Create menu.
- Choose Inventory System (at the top of the list) and select EdibleItemData.
- Fill in the item's values.
- Add the
PickUpscript to a GameObject. - Assign the item you created to the Item Data field of the
PickUpscript.
The GameObject is now an inventory item.
Using the save/load system? You need to assign IDs to your items through the database script. Otherwise, only the items present in the game scene will be saved.
DynamicInventorySystem is used to display backpacks and other containers such as chests. You may need to adapt it to your own needs.
- Create an empty Canvas object.
- Fill in its references as shown in the image below.
The prefab assigned to the Slot Prefab field is duplicated as many times as the inventorySize value in InventoryHolder, creating the inventory UI.
- The parent has the
InventorySlot_UIscript. - The first
Imageis the item sprite. - Slot Highlight can be any frame or border you like (how you use it is up to you).
- Item Count is a
TextMeshProtext.
- Game-Save-Load-System — the save/load system this inventory is designed to work with.
Issues and pull requests are welcome.
No license has been specified yet. Add a LICENSE file (for example MIT) to let others use this project.




