Skip to content

Pickup Component

Overview

UMIPItemPickupComponent handles the client-side pickup flow: it listens to interaction begin/end with item pickups, shows a popup list of rolled loot, and sends server RPCs to add items at an index or pickup all. It works with AMIPBaseItemPickup and UMIPInteractionComponent.

Key traits:

  • Attachment: PlayerController.
  • Flow: On interaction tag with item pickup → start pickup (show popup); user picks index or confirm all → ServerPickupItemAtIndex / ServerPickupAllItems; on confirm/cancel popup → stop pickup. Loot list comes from the pickup actor (FMIPRolledItemLoot).
  • Server: Server adds items to player inventory and removes from pickup; destroy actor when empty if applicable.

All paths below are relative to Plugins/ModularInventoryPlus/Source/ModularInventoryPlus/.


Key Classes & Files

Class File
UMIPItemPickupComponent Public/Pickup/MIPItemPickupComponent.h

UMIPItemPickupComponent

  • Base: UMIPBasePlayerControllerComponent.
  • Flow: BeginPlay / ClientBeginPlay_ImplementationBindInteractionComponentDelegates. OnItemPickupInteractionTagStartPickupItem(InInteractingItemPickup); OnItemPickupEndInteractionTagStopPickupItem. OnLootsChanged → refresh popup; OnPopupWidgetConfirmed → pickup one or all, then StopPickupItem.
  • Pickup: PickupItemAtIndex(InItemIndex)ServerPickupItemAtIndexPickupItemAtIndexInternal; RemoveRolledItemLootsAtIndex; optionally DestroyInteractingActor. PickupAllItemsServerPickupAllItemsPickupAllItemsInternal.
  • Overlap: OnBeginOverlapping, OnEndOverlapping – used to know when player is in range of a pickup for interaction.
  • Storage: Holds pointer to TArray<FMIPRolledItemLoot> from the interacting pickup actor; popup widgets (UMIPItemListPopupWidget, UMIPItemListPopupItemSlotWidget) display and confirm.

Integration

  • UMIPInteractionComponent – begin/end interaction tags drive StartPickupItem/StopPickupItem.
  • UMIPPlayerServerIMC – server adds items via inventory API.
  • AMIPBaseItemPickup – spawner or world actor that holds loot list and implements interactable interface.