Thank you for visiting this site.
This article provides a detailed guide to “Inventory”, one of Game Creator 2’s modules.
Inventory is a large-scale extension asset that comprehensively handles Item definitions / Bags (inventory) / Equipment / Currency / Merchants (shops) / Tinkering (crafting & dismantling) / Loot Tables (drops) / Sockets & Properties.
Official documentation: Game Creator 2 Documentation
You can find a complete list of all articles in this series here:
What is Inventory?
A module that covers virtually every scenario where items are handled in a game.
Main elements:
- Item: Item definition (ScriptableObject)
- Runtime Item: An individual instance of “that item” in the scene
- Bag: Container (component) for Items/Runtime Items
- Equipment: Equipment slot definition (ScriptableObject)
- Currency: Currency (ScriptableObject; can have multiple Coins)
- Merchant: Shop component
- Tinker: Opens crafting/dismantling UI
- Loot Table: Weighted random drops
- Sockets / Properties: Insert runes into weapons, hold variable values like attack power, etc.
Item vs Runtime Item
- Item: A template existing in the project (Prefab-like). Defines name, weight, default Property values, etc.
- Runtime Item: An instance in the scene. Can hold its own Property values (e.g., durability per sword)
- Save/Load target: Runtime Items are saved as individual instances
- Similar to Unity’s “Prefab ↔ Prefab Instance” relationship
Installation
- Purchase the Inventory module from the Asset Store
- Install via
Window > Package Manager - Install samples from
Game Creator > Install...:- Items: Ready-to-use template items
- UI: Inventory/shop/crafting UI templates
- Examples: Tutorial scene collection for each feature
- Examples depend on both Items and UI. Dependencies are auto-resolved
Items (Item Definitions)
Creation
Right-click in Project → Create > Game Creator > Inventory > Item
Item Section Structure
ID
A unique string. Duplicates show an error (red). Expand the field on the right → Regenerate to generate a new ID.
Prefab
Prefab reference for drops/instance generation. If not set, the item cannot be dropped.
Inheritance
Specifying another Item as Parent lets it inherit Properties and Sockets.
Comparison behavior: When A inherits from B, “Is A equal to B?” returns true (A is subordinate to B). “Is B equal to A?” returns false.
Information
Name / Description / Sprite / Color. Dynamic properties for localization are available.
Shape
- Width / Height: Occupied area in grid-type Bags
- Weight: Weight (compared against maximum weight)
- Max Stack: Maximum stack count for the same item
- Having even one Socket automatically limits Max Stack to 1 (technical constraint)
Price
Currency (only one can be specified) and a value. Prices of attached Socket items are also summed (e.g., Sword 45 + Rune 20 = 65).
Properties
Dynamic keyed values (e.g., attack = 35). Each has Icon / Color / Number / Text.
Sockets
Slots where other Items can be inserted. Specify a Base Item.
Equipping
Settings for equippable Items. Works with the combination of Equipment asset and Bag.
Usage
- Consume on Use: Whether consumed on use (potion vs. flute)
- Can Use (Conditions): Usage conditions. Cannot be used if conditions aren’t met
- On Use (Instructions): Executed on use.
Self = GameObject with the Bag,Target = Bag's Wearer - Execute From Parent: Execute the parent Item’s Can Use/On Use first before executing its own (pattern for consolidating common effects like all potions in the parent)
Crafting
Both recipes and materials recovered from dismantling can be defined.
Properties (Item Attributes)
Adding a Property
Add with the Add Property button. Each has ID (name) / Is Hidden / Icon / Color / Number / Text.
Mutable vs Immutable
- Mutable values change on Runtime Items (durability, remaining ammo, etc.)
- Immutable values don’t change during gameplay
Inheritance
Turn ON the Inherit Properties toggle at the top of the Item to inherit the parent’s Properties. Individual override values can be set with the left toggle (e.g., Shield > Wooden Shield has lower defense, Shield > Steel Shield has higher).
Hidden Properties
For internal flags not shown in UI (hidden attributes like is-metal).
C# Programming Through Unity 3D Game DevelopmentView on Amazon →
Unity Game Programming Bible 2nd GenerationView on Amazon →
Sockets (Item Linking)
Two Roles
- Socket Prefab: The appearance when this Item is inserted into another Item’s Socket (a Prefab with a Prop component)
- Sockets (receptacles): Slots where this Item accepts other Items
Receptacle Settings
Add with the Add Socket button.
- Base Item: The Item type to accept. All derived children are also accepted (specify Rune and Rune of Attack / Rune of Defense are all OK)
- Socket ID: ID used by the Prop component to identify the insertion position
Prop Component
Automatically mounts the Prefab inserted into a Socket at a specific position on your 3D model. Set the “insertion position (child Transform)” for each Socket ID.
Bags (Inventory Containers)
Types
- List Bag: List type arranged in order (recommended; easy to handle)
- Grid Bag: Grid placement. For fitting shaped items together (advanced)
Bag Options
- Maximum Height: Upper limit on the number of items that can be held
- Maximum Weight: Exceeding results in Overloaded status
- Height cannot be exceeded, but Weight allows adding items even when exceeded
- Equipment: Reference to an Equipment asset (optional)
Stock / Wealth
- Add Stock: Initial stock of Items and quantities (e.g., merchant’s starting items)
- Add Wealth: Currency and initial balance
- For random loot (treasure chests, etc.), Loot Tables are recommended
Skin UI
UI display skin for the Bag. Switch per use case (player inventory / treasure chest / shop).
Wearer
The target that actually wears equipped Items. Default is Self (when Bag and Character are on the same GameObject).
Equipment
Equipment Asset
Right-click in Project → Create > Game Creator > Inventory > Equipment
Equipment Slot
- Base Item: The Item type to accept (e.g., using a parent Item
Headas the base allows all helmets to be equipped) - Bone: Bone reference for displaying equipment. Dropdown for Humanoid, path specification for non-Humanoid
Standard Template Example
The included Equipment has 7 slots:
- Head / Body / Right Hand / Left Hand (equipment)
- 3 Consumables (consumable hotbar)
Currencies
Currency Asset
Right-click in Project → Create > Game Creator > Inventory > Currency
Multiple Coin Support
A Currency has one or more Coins. Each Coin is a “relative value to the base unit.”
Most games work fine with a single Coin (Gold 1). Decimals are not supported, so for 2 decimal places, manage values ×100 and shift for display.
Multiple Coin Example (Copper, Silver, Gold)
- Copper = 1 → Silver = 25 → Gold = 125 (= 5 Silver × 25 Copper)
- Give/take operations always use values converted to the base unit
Merchants (Shops)
Attach a Bag + Merchant component to the same GameObject.
Configuration
| Setting | Description |
|---|---|
| Infinite Currency | Infinite merchant currency (for buying from players) |
| Infinite Stock | Sale items never decrease |
| Allow Buy Back | Restock items the player sold |
| Sell Niche Type | Restrict sale Item types (Herbs specialist, etc.) |
| Buy Rate | Price multiplier when merchant sells to player (1.0 = list price) |
| Sell Rate | Price multiplier when merchant buys from player (typically 0.5 for half-price buyback) |
Tinkering (Crafting / Dismantling)
Overview
- Crafting: Make one item from multiple materials
- Dismantling: Break down one item to recover multiple materials
- How to open:
Open Tinker UIinstruction
Parameters
- Tinker Skin: Skin that determines crafting or dismantling
- Input Bag: Bag to take materials from
- Output Bag: Bag to place created items/materials. Usually the same, but can be separate
- Filter Item: Target Item type (narrow to Potion for Alchemy, Equipment for Forge, etc.)
Design Hints
The difference between genre-specific stations (forge/alchemy) is just changing the parent Item in Filter Item.
Loot Tables (Random Drops)
Creation
Right-click in Project → Create > Game Creator > Inventory > Loot Table
Entry Settings
- Rate: Weight (relative value, not probability). Drawn as a ratio to the total sum
- Loot: Choose Item or Currency
- Amount: Fixed or random quantity
- No Drop Rate: Weight for “nothing drops”
Execution
Instruction Loot Table → Specify the Loot Table asset + output Bag. One execution draws one entry. Running multiple times consecutively lets you “generate multiple items for a treasure chest.”
Typical Treasure Chest Pattern
Chest prefab with Trigger → Execute Loot Table instruction multiple times → Store in Chest’s own Bag. This way, treasure chests in a level are the exact same Prefab but with randomized contents.
User Interface (UI Components)
Three Types of Skins
| Skin Type | Related Component | Role |
|---|---|---|
| Bag Skin | Bag UI | Overall Bag display |
| Merchant Skin | Merchant UI | Shop transaction screen |
| Tinker Skin | Tinker UI | Crafting/dismantling screen |
Bag UI
- 2 types: Bag List UI (for List Bags) and Bag Grid UI (for Grid Bags)
- Parameters:
- Prefab Cell: Prefab for each cell (
Bag Cell UIcomponent required) - Filter by Parent: Item type filter for display (convenient for tabs)
- Content: Parent object where cell Prefabs are arranged
- Can Drop Outside: Allow dragging outside UI to drop in the world
- Max Drop Distance: Droppable distance
- Drop Amount: One / entire stack
- Prefab Cell: Prefab for each cell (
Related UI Components
| Component | Role |
|---|---|
| Cell UI | Each slot’s cell. Receives drag permission, drop/selection Instructions |
| Selected Cell UI | Detail display for the currently selected cell |
| Socket UI / Property UI | Child Prefab displaying one Socket/Property |
| Equip UI | Equipment slot / consumable hotbar UI |
| Wealth UI | Currency display |
| Weight | Current weight / max weight display |
Merchant UI
Bridges two Bag UIs (Merchant/Client). On Buy / On Sell (from the player’s perspective) can have Instructions assigned.
Tinker UI
Displays recipe/dismantle source list. Filter By Parent filters target Item types.
Visual Scripting Reference
Instructions (36)
Inventory > Bags (10)
| Instruction | Function |
|---|---|
| Add Item | Create new from Item type and add to Bag |
| Add Runtime Item | Add existing Runtime Item to Bag |
| Remove Item | Remove specified Item type from Bag |
| Remove Runtime Item | Remove specified Runtime Item from Bag |
| Drop Item | Drop Item type from Bag into the world |
| Drop Runtime Item | Drop Runtime Item into the world |
| Increment Bag Height | Increase Bag row count |
| Increment Bag Width | Increase Bag column count |
| Move Content To Bag | Move all Bag contents to another Bag |
| Move Wealth To Bag | Move all Bag currency to another Bag |
Inventory > Cooldowns (5)
| Instruction | Function |
|---|---|
| Add Item Cooldown | Add cooldown to an Item type |
| Add Runtime Item Cooldown | Add cooldown to a Runtime Item |
| Reset Item Cooldown | Reset Item cooldown |
| Reset Runtime Item Cooldown | Reset Runtime Item cooldown |
| Clear Cooldowns | Remove all Bag cooldowns |
Inventory > Currency (1)
| Instruction | Function |
|---|---|
| Change Currency | Add/subtract Bag currency value |
Inventory > Equipment (4)
| Instruction | Function |
|---|---|
| Equip Item | Equip an item from the Bag matching the Item type |
| Equip Runtime Item | Equip a specified Runtime Item |
| Unequip Item | Unequip equipment of the Item type |
| Unequip Runtime Item | Unequip a Runtime Item |
Inventory > Loot (2)
| Instruction | Function |
|---|---|
| Instantiate Item | Place an Item’s Prefab in the scene |
| Loot Table | Draw one entry from Loot Table to Bag |
Inventory > Sockets (2)
| Instruction | Function |
|---|---|
| Attach Runtime Item | Mount a Runtime Item to the first empty Socket |
| Detach Runtime Item | Remove a Runtime Item from a Socket |
Inventory > UI (10)
| Instruction | Function |
|---|---|
| Open Bag UI | Open the Bag UI |
| Close Bag UI | Close the Bag UI |
| Open Merchant UI | Open the shop UI |
| Close Merchant UI | Close the shop UI |
| Open Tinker UI | Open the crafting/dismantling UI |
| Close Tinker UI | Close the Tinker UI |
| Set Bag UI | Switch the Bag UI’s target Bag |
| Set Drop Amount | Switch drop behavior |
| Set Split Amount | Switch stack split behavior |
| Set Transfer Amount | Switch transfer behavior |
Inventory > Variables (2)
| Instruction | Function |
|---|---|
| Set Item | Save Item type to a Variable |
| Set Runtime Item | Save Runtime Item to a Variable |
Conditions (24)
| Category | Condition | Check |
|---|---|---|
| Inventory | Can Add | Whether the specified Item can be added to the Bag |
| Has Item | Whether the Bag contains at least a minimum quantity of the specified Item | |
| Has Runtime Item | Whether the Bag contains the specified Runtime Item | |
| Is Overloaded | Whether the Bag exceeds maximum weight | |
| Is Type Of Item | Whether an Item is equal to or subordinate to another Item | |
| Is Usable | Whether an Item is usable | |
| Bags | Enough Space | Whether the Bag has minimum free space |
| Cooldowns | Is Item Cooldown | Whether the specified Item is on cooldown |
| Is Runtime Item Cooldown | Whether the specified Runtime Item is on cooldown | |
| Equipment | Can Equip | Whether the specified Item can be equipped |
| Is Equipment Slot Free | Whether the specified slot is free | |
| Is Equippable | Whether the specified Item is equippable (as a type) | |
| Is Equipped | Whether equipment of the Item type is worn | |
| Is Runtime Item Equipped | Whether the specified Runtime Item is equipped | |
| Merchant | Can Buy | Whether the specified Item can be purchased from the Merchant |
| Can Sell | Whether the specified Item can be sold to the Merchant | |
| Properties | Item Has Property | Whether an Item has the specified Property |
| Runtime Item Has Property | Whether a Runtime Item has the specified Property | |
| Tinker | Can Craft | Whether the specified Item can be crafted |
| Can Dismantle | Whether the specified Item can be dismantled | |
| Enough Ingredients | Whether crafting materials are sufficient | |
| Is Craftable | Whether an Item has a crafting definition | |
| Is Dismantable | Whether an Item has a dismantle definition | |
| Wealth | Compare Wealth | Whether the specified currency value meets a condition |
Events (17)
| Category | Event | Fires When |
|---|---|---|
| Inventory | On Add | When an item is added to the Bag |
| On Remove | When an item is removed from the Bag | |
| On Drop Item | When a Bag item is dropped onto a Trigger | |
| On Instantiate Item | When an item is dropped from Bag to scene | |
| Currency | On Change Currency | When the Bag’s currency value changes |
| Equipment | On Equip / On Unequip | On equip / unequip |
| Merchant | On Buy / On Sell | On successful purchase / sale |
| Sockets | On Socket Attach / On Socket Detach | On Socket insert / remove |
| Tinker | On Craft / On Dismantle | On successful craft / dismantle |
| UI | On Open/Close Bag UI | Bag UI open/close |
| On Open/Close Merchant UI | Shop UI open/close | |
| On Open/Close Tinker UI | Tinker UI open/close |
Practical Usage — Configuration Guide by Goal
Use an HP Potion
- Create Item
Health Potion. In theUsagesection, setConsume on Use = true - Add Conditions to
Can Use(e.g., is the player alive?) - In
On Use, use the Stats module’sChange Attributefor HP +50 - Right-click from the UI hotbar → GC2 automatically fires the “use” process internally
Insert a Rune into a Weapon
- Add Base Item =
Runeto theSocketsof weapon ItemIron Sword - Create
Rune of Attackas a child Item ofRune(Property: attack +10) - Use Instruction
Attach Runtime Itemto mount a rune from the player’s inventory → onto the sword - In the attack Formula, sum
sword.attack + attached_rune.attack(Stats module)
Trade with a Merchant
- Attach
Bag+Merchantto the NPC,Add Stockto theBag - On
Interact, useOpen Merchant UIinstruction to start trading (Client Bag = Player's Bag) - Play sounds or notifications on Merchant UI’s
On Buy/On Sell
Random Treasure Chest Contents
- Add a
Bagcomponent to theChestPrefab On StartTrigger → CallLoot Table3 times- Player acquires items via
Open Bag UIon opening
Crafting Stations (Forge / Alchemy Differentiation)
Use the same Tinker UI and just swap the parent Item in Filter Item. Forge → Filter = Equipment, Alchemy → Filter = Potion.
Slow Movement Speed Based on Item Weight
On Trigger On Add / On Remove, check Is Overloaded. If true, use Change Movement Speed to reduce the character’s speed and display a notification UI.
Skill-like Usage with Cooldown
Use Add Item Cooldown to apply cooldown after use. In the UI, monitor remaining time with Is Item Cooldown and gray out the display.
Tips and Notes
- Max Stack is forced by Socket presence: Items with Sockets can differ per instance, making stacking impossible. When designing for stacking, use separate Items without sockets
- Leverage inheritance to reuse the same logic: Common processes like “play a voice on use” for all potions should be written in the parent Item’s On Use, with children relying on
Execute From Parent - Shift decimal values: Currency is integers only. If you need $0.50, treat it as 50 cents
- Grid Bag is a last resort: Unless you want shape-puzzle elements, List Bag is sufficient. UI implementation is significantly easier
- Don’t confuse Item and Runtime Item: Template vs. instance. Note that both variants exist for Equip/Drop/Has instructions
- Merchant Buy/Sell is from the player’s perspective: On Buy = when the player buys. Don’t interpret the names backwards
- Save targets: Runtime Items, Bag contents, equipment state, and cooldowns are all saveable by default (via the Save & Load system)
Move Content To BagandMove Wealth To Bagare separate instructions: You need both for a “take everything” from a treasure chest- Make full use of Filter by Parent: Tab separation, merchant genres, and crafting genres can all be controlled by parent Item type. Item hierarchy design is the key to success
Zero to Start! Unity Game Development — Your First TextbookView on Amazon →
The Game Developer's Map: Lessons from 20 Years of Solo DevelopmentView on Amazon →
Official Links
- Game Creator 2 Official Documentation
- Game Creator 2 — Unity Asset Store
- Inventory 2 | Game Creator 2 — Unity Asset Store
Summary
This article covered the Inventory module for Game Creator 2.
The Inventory module encompasses everything needed for in-game item management, from Item definitions to Bag management, equipment, currency, shop transactions, crafting, and random drops.
The Item inheritance-based type filtering system is particularly powerful — the design that controls tab separation, merchant genres, and crafting genres all through parent Item types provides robustness that doesn’t break down even in large-scale games.
We hope you’ll continue reading our next article as well.
📚 Series: Game Creator 2 Complete Guide (8/16)