Project Setup¶
This guide explains how to integrate the Modular Inventory System into your Godot 4.6 project.
Enabling the Plugin¶
- Copy the
addons/modular_inventory_system/folder into your project'sres://addons/directory. - Go to Project > Project Settings > Plugins.
- Check the Enable box next to Modular Inventory.
Autoloads¶
When you enable the plugin, inventory_plugin.gd automatically registers three global nodes that are always available (Autoloads). You do not need to add them manually:
| Autoload | Description |
|---|---|
DragDropSystem |
Handles global mouse input for dragging items, calculating drop targets, and dropping items into the 3D world. |
InputMode |
Manages mouse capture states (MOUSE_MODE_CAPTURED vs VISIBLE) so your player controller and UI don't fight for mouse control. |
UICoordinator |
Handles the positioning of multiple inventory panels (e.g., placing the player inventory on the right and a chest inventory on the left). |
InventoryComponent¶
To give a Node (like your Player or a Chest) an inventory, you must attach the InventoryComponent node to it.
- Capacity: Defines how many slots the inventory has.
- Slot Definitions: Allows you to assign specific
SlotRules to specific slots (e.g., slot 0 is for weapons only). - Create if Missing: If enabled, it will automatically generate a blank
Inventoryresource at runtime if you haven't assigned one in the inspector.