This is a minimal Unreal Engine 5.6 example project demonstrating how to use the SimpleInventory plugin.
The project shows how to:
- Define custom inventory item structs (Weapons & Ammo) that extend
FSimpleInventoryItem
. - Create Data Tables (
DT_Weapons
andDT_Ammo
) that hold metadata for those items. - Use a SimpleInventoryDefinitions Data Asset to define multiple inventories (
Weapons
andAmmunition
). - Register inventories with the SimpleInventorySubsystem (done in the Level Blueprint for demonstration).
- Add items into the inventories using Blueprint helper functions (
AddWeapon
andAddAmmo
).
- Unreal Engine 5.6+ (tested with 5.6, should with 5.3+, but untested).
- The SimpleInventory plugin must be installed and enabled.
Note: For the SimpleInventory classes to be available for #include
in C++, you must add SimpleInventory
as a dependency in your project's .uproject
file. As shown below under Modules -> AdditionalDependencies
:
{
"FileVersion": 3,
"EngineAssociation": "5.6",
"Category": "",
"Description": "",
"Modules": [
{
"Name": "InventoryExample",
"Type": "Runtime",
"LoadingPhase": "Default",
"AdditionalDependencies": [
"CoreUObject",
"SimpleInventory"
]
}
],
"Plugins": [
{
"Name": "ModelingToolsEditorMode",
"Enabled": true,
"TargetAllowList": [
"Editor"
]
}
]
}
- Clone this repository (or download the ZIP).
- Open the project in Unreal Engine.
- Ensure the SimpleInventory plugin is enabled.
- Open the included Level Blueprint to see how inventories are registered and items are added.
Two item types are defined to demonstrate extending FSimpleInventoryItem
:
// Ammo Item
USTRUCT(BlueprintType)
struct FAmmoInventoryItem : public FSimpleInventoryItem
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Ammo Inventory Item")
EAmmoType AmmoType;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Ammo Inventory Item")
TArray<int32> SupportedWeaponIDs;
};
// Weapon Item
USTRUCT(BlueprintType)
struct FWeaponInventoryItem : public FSimpleInventoryItem
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Weapon Inventory Item")
EWeaponType WeaponType;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Weapon Inventory Item")
int32 AmmoClipCount;
};
- DT_Weapons – Defines weapon metadata (EWeaponType, clip size, etc.).
- DT_Ammo – Defines ammo metadata (EAmmoType, supported weapons, etc.).
These tables serve as the source of truth for all item definitions.
A SimpleInventoryDefinitions
Data Asset defines two inventories:
- Weapons Inventory
- Ammunition Inventory
These are registered with the USimpleInventorySubsystem
in the Level Blueprint for demonstration.
Two helper functions are included in the Level Blueprint:
AddWeapon
(FWeaponInventoryItem
) – Adds a weapon to the Weapons Inventory.AddAmmo
(FAmmoInventoryItem
) – Adds ammo to the Ammunition Inventory.
These show how to pass custom structs into the inventory system.
By exploring this project, you’ll learn how to:
- Extend FSimpleInventoryItem to create custom inventory item types.
- Organize metadata using Data Tables.
- Define multiple inventories using a Data Asset.
- Register inventories and add items using Blueprints.
- No gameplay interaction yet (no pickups, UI, or player inventory management).
- Inventories are registered in the Level Blueprint (for simplicity).
- For production: register them in a custom GameInstanceSubsystem, PlayerController, or another persistent system.
MIT License – free to use in commercial and non-commercial projects. © Eric Downey, 2025