UE5 Blueprint Inventory
In this tutorial, you will build a complete Blueprint inventory system in Unreal Engine 5 using a clean and expandable architecture. The system uses a data struct for inventory items, an Actor Component for inventory storage, a Blueprint Interface for pickup interaction, UMG widgets for the inventory UI, and simple Blueprint logic for adding, stacking, removing, displaying, and dropping items.
This inventory system is built inside the Third Person Template, but the architecture is not limited to third-person games. You can reuse the same structure in RPGs, survival games, top-down games, shooters, farming games, crafting systems, or any project where the player needs to collect and manage items.
The main goal is not just to make something that works. The goal is to build the system in a way that is understandable, modular, and easy to expand later. That means we avoid hardcoding item logic directly into the player wherever possible, and instead separate responsibilities between data, components, actors, interfaces, and UI widgets.
Watch the full video tutorial: Unreal Engine Blueprint Inventory Systems in Under 30 Minutes
More Unreal Engine tutorials: rambod.net
Subscribe for more Unreal Engine tutorials: Rambod YouTube Channel
What You Will Build
By the end of this tutorial, you will have a working inventory system with pickup items, stack support, a reusable inventory component, a visual UMG inventory panel, item icons, a drop button, and input logic to open and close the inventory screen.
The final system includes:
- A reusable item data struct
- An inventory Actor Component
- Add item logic with stacking support
- Remove item logic
- A Blueprint Interface for modular pickup interaction
- A pickup actor that stores item data
- Auto-pickup behavior using overlap detection
- A reusable inventory item widget
- A main inventory panel widget
- A Uniform Grid Panel for item layout
- Inventory toggle input using the I key
- Mouse cursor and input mode handling
- Drop button logic with UI refresh
- Test items with names, IDs, quantities, icons, and meshes
System Architecture Overview
Before building the inventory, it is important to understand the structure. A messy inventory system usually happens when every feature is placed directly inside the player Blueprint. That works for a quick prototype, but it becomes painful when you add containers, equipment, item effects, shops, crafting, multiplayer, saving, or drag and drop UI.
A cleaner inventory system separates responsibilities.
InventoryItemStruct
Stores item data
InventoryComponent
Stores inventory array
Handles add, stack, and remove logic
BPI_InventoryInteract
Defines how pickup actors communicate with the inventory system
BP_PickupItem
Represents an item in the world
WBP_InventoryItem
Displays one item inside the UI
WBP_InventoryPanel
Displays the full inventory list
BP_ThirdPersonCharacter
Owns the Inventory Component
Detects pickups
Toggles inventory UI
This structure is not overengineering. It is the minimum reasonable separation for an inventory system that you may actually want to expand later.
Why Use a Struct for Inventory Items?
An inventory item needs data. At minimum, the system needs to know what the item is, what icon it should display, and how many of that item the player owns.
Instead of creating separate variables everywhere, we use a Blueprint Struct. A struct lets us group related item fields into one data type.
A simple item struct might include:
- Item name
- Item ID
- Item icon
- Quantity
This makes the system cleaner because every item follows the same data format.
Step 1: Create the Inventory Item Struct
In the Content Drawer, right-click and create a new Blueprint Structure.
Right-click → Blueprints → Structure
Name it:
InventoryItemStruct
Open the struct and add these variables:
- ItemName as Text
- ItemID as Integer
- ItemIcon as Texture2D
- Quantity as Integer
Recommended default values:
ItemName = empty
ItemID = 0
ItemIcon = none
Quantity = 1
The ItemID is important because it gives you a stable way to compare items. Item names can change, localized text can change, and icons can change. A numeric ID is cleaner for checking whether two items are the same.
Inventory Item Struct Explained
ItemName
ItemName is the display name shown to the player. Use Text instead of String because Text is better suited for UI display and localization.
ItemID
ItemID is the unique identifier used by the inventory logic. When adding an item, the system checks whether another item with the same ID already exists. If it does, the quantity is increased instead of adding a duplicate slot.
ItemIcon
ItemIcon is the Texture2D shown inside the inventory UI. This makes the item visual in the inventory panel.
Quantity
Quantity stores how many of this item the player owns. For stackable items like coins, mushrooms, ammo, potions, or crafting materials, this is essential.
Step 2: Create the Inventory Component
Next, create an Actor Component to hold the inventory logic.
Right-click → Blueprint Class → Actor Component
Name it:
InventoryComponent
Open the component and create a new variable:
InventoryItems
Set the variable type to:
InventoryItemStruct
Then make it an Array.
This array is the actual inventory storage. Every item the player collects will be stored inside this array.
Why Use an Actor Component?
You could place inventory logic directly inside the player Blueprint, but that is a weak architecture. It ties the inventory to one specific character and makes the system harder to reuse.
Actor Components are better because they can be attached to different actors.
For example, the same InventoryComponent could later be used by:
- The player character
- AI characters
- storage chests
- loot containers
- vendors
- crafting stations
- dead enemies that drop loot
This is the point of component-based architecture. You build the logic once, then reuse it.
Step 3: Create the Add Item Function
Inside the InventoryComponent, create a new function:
AddItem
Add one input:
Item : InventoryItemStruct
This function receives an item and decides whether to stack it with an existing item or add it as a new entry.
The logic should work like this:
- Loop through the InventoryItems array.
- Compare each existing item’s ItemID with the incoming item’s ItemID.
- If a matching ItemID is found, add the incoming quantity to the existing quantity.
- Update the existing array element.
- Stop the function.
- If no match is found, add the incoming item to the array as a new entry.
Add Item Blueprint Logic
The function can be built with these Blueprint concepts:
- For Each Loop
- Break InventoryItemStruct
- Equal Integer comparison for ItemID
- Branch
- Add Integer for quantity stacking
- Make InventoryItemStruct or Set Members in InventoryItemStruct
- Set Array Element
- Add node for array append
- Return Node
The important part is that the function must not always add a new entry. If the item already exists, it should update quantity instead.
The simplified logic looks like this:
For each ExistingItem in InventoryItems:
If ExistingItem.ItemID == Item.ItemID:
ExistingItem.Quantity = ExistingItem.Quantity + Item.Quantity
Set Array Element at current index
Return
Add Item to InventoryItems
Why Stack by ItemID?
Stacking should be based on identity, not display name. If you compare by ItemName, you can easily break the system later when adding localization, renaming items, or using two items with similar names.
ItemID is cleaner:
ItemID 1 = Mushroom
ItemID 2 = Canned Fish
ItemID 3 = Backpack
If the player picks up another Mushroom with ItemID 1, the system knows it should stack with the existing Mushroom entry.
Step 4: Create the Remove Item Function
Inside the InventoryComponent, create another function:
RemoveItem
Add one input:
ItemID : Integer
This function removes an item from the InventoryItems array based on its ItemID.
The basic logic is:
- Loop through InventoryItems.
- Compare each item’s ItemID with the input ItemID.
- If a match is found, remove that array index.
- Exit the function.
Simplified logic:
For each ExistingItem in InventoryItems:
If ExistingItem.ItemID == ItemID:
Remove Index
Return
In this version, RemoveItem removes the full stack. Later, you can expand it to remove only one quantity from the stack.
Full Stack Removal vs Quantity Removal
The tutorial version removes the item entry from the inventory. That is fine for a beginner system and for a simple drop button.
In a more advanced inventory, RemoveItem should probably support an amount input.
RemoveItem(ItemID, Amount)
Then the logic becomes:
- If Quantity is greater than Amount, subtract Amount.
- If Quantity becomes zero or less, remove the item from the array.
This is one of the easiest future upgrades for the system.
Step 5: Create the Inventory Interface
Now we need a clean way for world pickup items to communicate with the player inventory. We do not want the player Blueprint to know every possible pickup class in the game.
This is where a Blueprint Interface helps.
Create a new Blueprint Interface:
Right-click → Blueprint Interface
Name it:
BPI_InventoryInteract
Add two interface functions:
GetItemData
OnCollected
Configure them like this:
- GetItemData outputs InventoryItemStruct.
- OnCollected has no output and handles what happens after collection.
Why Use a Blueprint Interface?
A Blueprint Interface lets different actors respond to the same function calls without requiring the player to cast to a specific class every time.
This means the player can interact with anything that implements BPI_InventoryInteract.
Later, this could include:
- world pickup items
- lootable crates
- enemy drops
- quest items
- resource nodes
- containers
The player only needs to ask:
Does this actor implement BPI_InventoryInteract?
If yes, it can request item data and collect it.
Step 6: Create the Pickup Item Actor
Create a new Actor Blueprint:
Right-click → Blueprint Class → Actor
Name it:
BP_PickupItem
Open it and add these components:
- Static Mesh for the visible item
- Sphere Collision for pickup detection
Select the Sphere Collision and set a reasonable radius.
Sphere Radius = 50
Configure the collision so it can detect overlap with the player.
Collision Preset = Overlap All Dynamic
Generate Overlap Events = true
Step 7: Add Item Data to the Pickup
Inside BP_PickupItem, create a variable:
ItemData
Set its type to:
InventoryItemStruct
Enable:
- Instance Editable
- Expose on Spawn
Instance Editable is important because it lets you place multiple pickup actors in the level and configure each one differently.
For example, one pickup can be a mushroom, another can be canned fish, and another can be a backpack, all using the same BP_PickupItem class.
Step 8: Implement the Interface in the Pickup Actor
In BP_PickupItem, go to Class Settings and add the interface:
BPI_InventoryInteract
Implement the two functions.
GetItemData
Return the ItemData variable.
Return ItemData
OnCollected
Destroy the actor.
Destroy Actor
This means when the player collects the item, the pickup actor removes itself from the world.
Why Pickup Data Should Be Editable Per Instance
A bad inventory setup creates a different Blueprint for every item. That quickly becomes a mess.
A better setup uses one pickup Blueprint and changes its ItemData per instance.
Example level setup:
BP_PickupItem instance 1:
ItemName = Mushroom
ItemID = 1
Quantity = 1
BP_PickupItem instance 2:
ItemName = Canned Fish
ItemID = 2
Quantity = 1
BP_PickupItem instance 3:
ItemName = Coin
ItemID = 3
Quantity = 10
Same Blueprint. Different data. Cleaner project.
Step 9: Add Inventory Component to the Player
Open BP_ThirdPersonCharacter.
In the Components panel, add:
InventoryComponent
Now the player owns an inventory.
This is better than storing the inventory array directly in the character because the character can call the component, while the component owns the inventory logic.
Step 10: Auto-Pickup Logic in the Player
Inside BP_ThirdPersonCharacter, use the overlap event to detect pickup actors.
You can use:
Event ActorBeginOverlap
The logic should be:
- When the player overlaps another actor, check if the actor implements BPI_InventoryInteract.
- If true, call GetItemData on the actor.
- Pass that item data into InventoryComponent AddItem.
- Call OnCollected on the actor.
Simplified logic:
Event ActorBeginOverlap
OtherActor → Does Implement Interface BPI_InventoryInteract
Branch
True:
GetItemData
InventoryComponent → AddItem
OnCollected
Why This Auto-Pickup Design Works
This setup is simple but powerful. The player does not care what exact class the pickup is. The player only checks whether the actor supports the inventory interface.
That keeps the interaction modular.
Later, you can replace auto-pickup with interact-to-pickup using the E key, line traces, or interaction prompts. The interface still works.
Step 11: Create the Inventory Item UI Widget
Now we need a widget that displays one item inside the inventory.
Create a new Widget Blueprint:
WBP_InventoryItem
Inside the Designer, create a simple layout:
- Canvas Panel root
- Image for item icon
- Button for dropping the item
- Text Block inside the button with the text Drop
Example widget size:
Icon Image = 100 x 100
Drop Button = 100 x 40
This widget represents one inventory slot item.
Step 12: Add ItemData Variable to the Item Widget
In WBP_InventoryItem, create a variable:
ItemData
Set its type to:
InventoryItemStruct
Enable:
- Instance Editable
- Expose on Spawn
This allows the main inventory panel to create item widgets and pass item data into them immediately.
Step 13: Show the Item Icon
In WBP_InventoryItem, use Event Construct to update the icon.
The logic:
- Break ItemData.
- Get ItemIcon.
- Set Brush from Texture on the Image widget.
Simplified:
Event Construct
ItemData → Break InventoryItemStruct
ItemIcon → Set Brush From Texture
Now each item widget can display its own icon based on the data passed into it.
Step 14: Create the Main Inventory Panel
Create another Widget Blueprint:
WBP_InventoryPanel
This is the main inventory screen.
In the Designer, create a layout like this:
Canvas Panel
Background Image or Border
Uniform Grid Panel
Close Button
Set the inventory panel to a reasonable size, for example:
Panel Size = 400 x 600
Add a Uniform Grid Panel and rename it:
ItemGrid
Make sure ItemGrid is marked as Variable so it can be accessed from the Graph.
Why Use Uniform Grid Panel for Inventory?
A Uniform Grid Panel is a good basic choice for inventory UI because it places items into clean rows and columns with evenly sized cells.
If your inventory has fixed-size item slots, Uniform Grid Panel is straightforward and readable.
Example:
Row 0: Slot 0, Slot 1, Slot 2, Slot 3
Row 1: Slot 4, Slot 5, Slot 6, Slot 7
Row 2: Slot 8, Slot 9, Slot 10, Slot 11
For more advanced inventories, you may later use TileView, ListView, ScrollBox plus WrapBox, or a custom drag and drop grid. But for this tutorial, Uniform Grid Panel is the right balance between simple and useful.
Step 15: Populate the Inventory Panel
Inside WBP_InventoryPanel, create a custom event:
UpdateInventoryList
This event refreshes the inventory UI based on the current InventoryItems array.
The logic should be:
- Clear Children on ItemGrid.
- Get Player Character.
- Cast to BP_ThirdPersonCharacter.
- Get InventoryComponent.
- Get InventoryItems array.
- Loop through the array.
- Create WBP_InventoryItem for each item.
- Pass ItemData into the widget.
- Add the widget to the Uniform Grid Panel.
Grid Row and Column Calculation
To place inventory items in a grid, you need to calculate row and column from the array index.
Choose a max column count. For example:
MaxColumns = 4
Then calculate:
Row = Index / MaxColumns
Column = Index % MaxColumns
In Blueprint:
- Integer division gives the row.
- Modulo gives the column.
Example:
Index 0 → Row 0, Column 0
Index 1 → Row 0, Column 1
Index 2 → Row 0, Column 2
Index 3 → Row 0, Column 3
Index 4 → Row 1, Column 0
Index 5 → Row 1, Column 1
This is a standard grid placement pattern and it is useful far beyond inventory systems.
Step 16: Refresh the Inventory on Construct
In WBP_InventoryPanel, call UpdateInventoryList from Event Construct.
Event Construct → UpdateInventoryList
This ensures the inventory UI is populated as soon as it appears on screen.
If the inventory array already has items, they will immediately show up in the grid.
Step 17: Add Close Button Logic
Add a Close Button to WBP_InventoryPanel.
On Clicked:
Remove From Parent
This closes the inventory UI.
Later, you can also notify the player character that the inventory was closed so the input mode and cursor state can be restored. For a beginner system, removing the widget is enough to demonstrate the concept.
Step 18: Toggle Inventory with the I Key
Open BP_ThirdPersonCharacter.
Add input logic for the I key.
Basic flow:
- Press I.
- If inventory is closed, create WBP_InventoryPanel and add it to viewport.
- Set input mode to Game and UI.
- Show mouse cursor.
- If inventory is open, remove it from parent.
- Set input mode back to Game Only.
- Hide mouse cursor.
You can use a FlipFlop node for a simple version.
I Key Pressed
FlipFlop
A: Open Inventory
B: Close Inventory
Inventory Widget Reference
When creating the inventory widget, promote the return value to a variable.
InventoryPanelRef
This reference lets you remove the same widget later.
Without a stored reference, many beginners accidentally create multiple inventory widgets on top of each other and then wonder why the UI behaves strangely.
Mouse Cursor and Input Mode
When the inventory is open, the player needs to click buttons. That means the mouse cursor must be visible, and the input mode must allow UI interaction.
When opening the inventory:
Set Input Mode Game and UI
Set Show Mouse Cursor = true
When closing the inventory:
Set Input Mode Game Only
Set Show Mouse Cursor = false
This gives the player normal gameplay controls when the UI is closed and UI interaction when the inventory is open.
Step 19: Drop Button Logic
In WBP_InventoryItem, select the Drop button and add an OnClicked event.
The logic:
- Get Player Character.
- Cast to BP_ThirdPersonCharacter.
- Get InventoryComponent.
- Break ItemData.
- Get ItemID.
- Call RemoveItem on InventoryComponent.
- Refresh the inventory UI.
Simplified:
Drop Button OnClicked
Get Player Character
Cast to BP_ThirdPersonCharacter
Get InventoryComponent
RemoveItem(ItemData.ItemID)
Refresh UI
This removes the item from the array and updates the displayed inventory.
Refreshing UI After Dropping Items
Removing the item from the data array is not enough. The UI must also be refreshed, otherwise the old widget may still be visible until the inventory is reopened.
This is why UpdateInventoryList is useful.
The refresh process should:
- Clear the grid.
- Read the current inventory array.
- Rebuild the item widgets.
This is not the most optimized method for massive inventories, but it is clean and reliable for beginner and medium-size systems.
Step 20: Add Test Item Icons
To test the inventory properly, import some icons into Unreal Engine.
You can use simple placeholder icons first. Examples:
- Mushroom icon
- Canned fish icon
- Backpack icon
- Potion icon
- Coin icon
Assign these textures to the ItemIcon field on BP_PickupItem instances in the level.
Step 21: Place Test Items in the Level
Drag BP_PickupItem into the level multiple times.
Configure each placed instance with different ItemData.
Example:
Pickup 1:
ItemName = Mushroom
ItemID = 1
ItemIcon = T_Mushroom
Quantity = 1
Pickup 2:
ItemName = Canned Fish
ItemID = 2
ItemIcon = T_CannedFish
Quantity = 1
Pickup 3:
ItemName = Mushroom
ItemID = 1
ItemIcon = T_Mushroom
Quantity = 3
When the player collects Pickup 1 and Pickup 3, they should stack together because both use ItemID 1.
Step 22: Final Test
Now test the full system.
- Press Play.
- Walk into a pickup item.
- The pickup should disappear from the level.
- Press I to open the inventory.
- The item should appear in the inventory UI.
- Collect another item with the same ItemID.
- The quantity should stack.
- Click Drop.
- The item should be removed from the inventory.
- The UI should refresh.
If all of that works, you now have the foundation of a real inventory system.
Common Problem: Item Does Not Pick Up
If the item does not get picked up, check these points:
- Does BP_PickupItem implement BPI_InventoryInteract?
- Is Sphere Collision set to overlap the player?
- Is Generate Overlap Events enabled?
- Is the player overlap event firing?
- Does the player have the InventoryComponent?
- Are you calling GetItemData through the interface message?
Common Problem: Item Does Not Show in UI
If the item is added but not visible in the inventory UI, check:
- Is Event Construct calling UpdateInventoryList?
- Is the ItemGrid marked as Is Variable?
- Is the inventory array actually populated?
- Are you creating WBP_InventoryItem for every array element?
- Are you passing ItemData into the widget on spawn?
- Is the icon texture valid?
- Is the widget being added to the grid?
Common Problem: Drop Button Removes Data but UI Does Not Change
This means your data logic works, but your UI is stale.
After calling RemoveItem, you need to refresh the inventory panel.
RemoveItem
UpdateInventoryList
If the item widget does not have a reference to the parent panel, you need to pass that reference when creating the widget or use another clean communication method.
Common Problem: Multiple Inventory Panels Open
This happens when you create a new WBP_InventoryPanel every time the key is pressed but never store the reference.
Fix:
- Promote the Create Widget return value to InventoryPanelRef.
- Check Is Valid before creating another one.
- Remove the existing widget when closing.
Common Problem: Mouse Cursor Does Not Work
If you cannot click the inventory buttons, you probably did not change the input mode or show the mouse cursor.
When inventory opens:
Set Input Mode Game and UI
Show Mouse Cursor = true
When inventory closes:
Set Input Mode Game Only
Show Mouse Cursor = false
How to Expand This Inventory System
This tutorial gives you a strong foundation, but inventory systems can grow in many directions.
Possible upgrades:
- Stack limits
- Partial quantity removal
- Item descriptions
- Item rarity
- Item categories
- Equipment slots
- Consumable item effects
- Drag and drop UI
- Item sorting
- Item filtering
- Inventory weight system
- Saving and loading inventory data
- Chest and container inventories
- Shop and vendor systems
- Crafting system integration
Recommended Next Upgrade: Stack Limits
Stack limits prevent infinite stacking.
Add another field to InventoryItemStruct:
MaxStackSize : Integer
Then update AddItem so it only stacks up to MaxStackSize. If the incoming quantity exceeds the limit, create another stack.
This is useful for survival games, RPG inventories, and resource systems.
Recommended Next Upgrade: Item Database
In a larger project, you should not manually enter every item’s data into every pickup actor.
A better long-term approach is to create an item database using Data Tables or Primary Data Assets.
Then the pickup only stores an ItemID or ItemDataAsset reference, and the system pulls the full data from the database.
Better data structure:
Pickup Actor
ItemID = 1
Item Database
ID 1 = Mushroom data
ID 2 = Canned Fish data
ID 3 = Backpack data
This avoids duplicate item configuration across the project.
Recommended Next Upgrade: Drag and Drop
Drag and drop makes the inventory feel much more interactive.
You can extend WBP_InventoryItem with UMG drag events:
- On Mouse Button Down
- Detect Drag If Pressed
- On Drag Detected
- On Drop
This lets players rearrange items, move items into equipment slots, or transfer items between inventory and containers.
Recommended Next Upgrade: Equipment Slots
If you want RPG-style equipment, add equipment slots such as:
- Weapon
- Helmet
- Chest Armor
- Boots
- Ring
- Consumable Slot
Then extend the item struct with an ItemType or EquipmentSlotType enum.
ItemType:
Consumable
Weapon
Armor
Quest
Material
This makes it possible to validate where each item can go.
Recommended Next Upgrade: Save and Load
Inventory systems need persistence. The easiest way to save this system is to store the InventoryItems array inside a SaveGame object.
Basic save flow:
Create SaveGame Object
Set SavedInventoryItems = InventoryComponent.InventoryItems
Save Game To Slot
Basic load flow:
Load Game From Slot
Set InventoryComponent.InventoryItems = SavedInventoryItems
UpdateInventoryList
This is a natural follow-up once the inventory system works in memory.
Best Practices for This Inventory System
- Keep inventory data inside a struct.
- Use ItemID for comparisons.
- Keep inventory logic inside an Actor Component.
- Use interfaces for pickup communication.
- Use reusable widgets for item slots.
- Refresh UI after inventory changes.
- Store widget references when toggling UI.
- Do not hardcode pickup classes into the player if an interface can solve it.
- Do not duplicate item logic across multiple Blueprints.
- Plan early for stack limits, item types, and saving.
What This Tutorial Teaches Beyond Inventory
This tutorial is not only about inventory. It teaches several important Unreal Engine architecture patterns.
- Structs for clean data grouping
- Actor Components for reusable gameplay logic
- Blueprint Interfaces for modular communication
- UMG widgets for reusable UI elements
- Grid placement math for dynamic UI layouts
- Input mode switching for gameplay and UI control
These patterns are useful in many systems, not just inventory. You can reuse the same thinking for quest systems, ability systems, shop systems, crafting systems, and interaction systems.
Conclusion
In this tutorial, you built a modular inventory system in Unreal Engine 5 using Blueprints, Actor Components, Blueprint Interfaces, and UMG. The system supports pickup actors, item data, stacking, item removal, dynamic UI generation, inventory toggling, mouse input, and drop button functionality.
The most important part is the architecture. The inventory is not just a random group of Blueprint nodes. The data lives in a struct, the logic lives in a component, pickups communicate through an interface, and the UI is built from reusable widgets.
This is the right foundation if you want to expand into drag and drop, equipment, saving, item effects, crafting, containers, or shop systems later.
Watch the full video tutorial: Unreal Engine Blueprint Inventory Systems in Under 30 Minutes
More Unreal Engine tutorials: rambod.net
Subscribe for more Unreal Engine tutorials: Subscribe to Rambod on YouTube
Resources
Frequently Asked Questions
Can this inventory system work outside the Third Person Template?
Yes. The system is built in the Third Person Template for convenience, but the architecture works in RPGs, survival games, top-down games, shooters, and other Unreal Engine projects.
Why use an Actor Component for inventory?
An Actor Component keeps inventory logic reusable. You can attach it to players, NPCs, containers, vendors, or other actors instead of hardcoding inventory inside one character Blueprint.
Why use a Blueprint Interface for pickups?
A Blueprint Interface lets the player interact with any actor that provides item data, without needing to cast to one specific pickup class every time.
Does this inventory support stacking?
Yes. The AddItem function checks ItemID. If the item already exists, it increases quantity instead of adding a duplicate entry.
Does the Drop button remove the item from the world or only from the inventory?
In this version, the Drop button removes the item from the inventory array and refreshes the UI. You can expand it later to spawn the item back into the world.
Can I add drag and drop later?
Yes. The reusable item widget is a good starting point for drag and drop logic. You can later add UMG drag events and slot-based item movement.
Can I save this inventory?
Yes. Store the InventoryItems array inside a SaveGame object, then load it back into the InventoryComponent when the game starts.
Should I use a Data Table for items?
For a larger project, yes. A Data Table or Primary Data Asset setup is better than manually configuring item data on every pickup actor.
Related Tutorials
More lessons connected by category, tags, engine version, or implementation type.
Recommended resource
Recommended for this tutorial
Useful tools selected for this workflow topic.