Your First Inventory
This minimal test separates item registration from UI setup.
- Add
InventoryComponentto your player Pawn or Character. ConfigureInventoryIdentityTagasCube_Inventory.Target.Character.Inventory,CapacityTypeasSlotBasedandMaxInventorySlotsas 10. - Create an item Data Asset of class
PDA_InventoryMaster. SetItemIDtoApple,ItemTypeto Food,bCanStackto true,MaxStackSizeto 10 andWeightto 0.2. - Create
PDA_ItemDatabase, setInventoryKeyto Food andTargetInventoryTagto the same component tag. Add the Apple master toEntrys. - Add that database to
DatabaseArrayin Project Settings → Cube Game Systems → Inventory SubSystem. - Start PIE. Obtain the Game Instance's
InventorySubSystem. Wait untilGetItemByID(Apple)andGetDatabaseByItemID(Apple)return valid objects. The subsystem can exist while database loading is still in progress. - On authority, call
AddAmountwith your Pawn, Apple and amount 3. CheckbSuccessandOutAddedAmount. - Resolve the component with
GetInventoryCompByTag, then readGetInventory. Expect an entry with a validSlotID,ItemID = AppleandStackSize = 3. - Call
RemoveAmountfor 1 and verify the remaining quantity is 2.
For UI, create and assign slot data, configure PayloadClass, InventoryEntryClass and a ToolTipMap entry for Food, then create an Inventory Frame with an owning player. For clients, submit the operation through the Server RPC integration.
Avoid arbitrary delays as a loading contract. Use a bounded project readiness check and show a loading/error state if registration fails. See Subsystem Lifecycle.