World Pickups & Loot
Physical items and proximity looting
The plugin provides a standardized way to interact with dropped items and physical loot actors in the world via the IMP_InventoryPickupInterface.
The Pickup Interface
Any Actor that is meant to be picked up or dropped from an inventory must implement UMP_InventoryPickupInterface. This provides two core Blueprint Native Events:
1. GetPickupData
- Purpose: Called by the server when a player attempts to loot this item from the ground.
- Implementation: Blueprint actors must implement this to return their current
OutItemID(FName) andOutQuantity(int32).
2. SetPickupData
- Purpose: Called by the inventory system immediately after dropping or spawning the item into the world.
- Implementation: Blueprint actors should implement this to receive dynamic quantity and item data from the C++ backend and update their visual state (e.g., swapping a mesh based on the
ItemID).
Dropping Items
When dropping an item from the inventory, the Manager or Component handles spawning the designated physical Actor and immediately calls SetPickupData on it. The Actor then replicates its physical state to clients, ensuring the UI and world representation stay perfectly in sync.
Looting Items
When looting, the Player Controller (via UMP_InventoryManager) interacts with an Actor implementing IMP_InventoryPickupInterface. The Manager calls GetPickupData to determine exactly what is being looted, securely validates the addition on the server, and commands the Actor to destroy itself upon successful loot.