Pickup && Dropper System

avatar`
Yuewu(罗传月武)
Updated: Jul 23, 2025

Overview

The Generic Inventory System (GIS) offers a highly flexible pickup and drop system for items. This document provides a detailed explanation of their usage and how to extend their functionality.

Pickup System

GIS provides three default pickup systems: Item Pickup, Inventory Pickup (Loot), and Currency Pickup. All of these inherit from GIS_PickupComponent, each with their own configurations and logic. The pickup logic can be executed by calling the Pickup function.

1. Item Pickup

  • Purpose: Used for picking up a single item at a time, such as weapons or armor dropped on the ground.
  • Implementation:
    • Add GIS_WorldItemComponent and GIS_ItemPickupComponent to any Actor to create an ItemPickupActor.
    • Component Details:
      • WorldItemComponent: Creates and holds an item instance in the world.
      • ItemPickupComponent: Adds the referenced item from WorldItem to the interactor's inventory.

2. Inventory Pickup (Loot)

  • Purpose: Used for picking up multiple items at once, such as treasure chests or enemy drops after death in the game.
  • Implementation:
    • Add GIS_InventoryPickupComponent to any Actor with an InventorySystem component to create an InventoryPickupActor.
    • Component Details:
      • InventorySystemComponent: Configures all items that can be picked up.
      • ItemPickupComponent: Transfers items from the specified collection to the interactor's inventory.

3. Currency Pickup

  • Implementation:
    • Add GIS_CurrencySystemComponent and GIS_CurrencyPickupComponent to any Actor to create a CurrencyPickupActor.
    • Logic Details:
      • Upon pickup, all currency from the picked-up object's CurrencySystem component is removed and added to the picker’s CurrencySystem component.

Case Study: BP_GIS_ItemPickup Blueprint

Simply using pickup components is not sufficient for a complete game experience. In practical applications, the pickup system needs to integrate with interaction, UI, and item visual effects to provide full functionality. The GIS companion project comes pre-configured with these features, ready to use out of the box.

Using the blueprint BP_GIS_ItemPickup provided in the companion project as an example:

  • Place this blueprint in your level and configure it as needed.
  • The blueprint includes the following components:
    • StaticMesh Component: Controls the visual appearance of the pickup.
    • Pickup Component: Specifies which inventory collection the item will be picked up into and manages success/failure audio feedback.
    • SmartObject Component: Defines the interaction entry point for the PickupActor. Actors with interaction system components (e.g., players or AI) can search and interact with it to trigger pickup.
    • WorldItem Component: Configures an item definition and its quantity, creating and holding the item instance at runtime. Upon successful pickup, the item instance is added to the player's specified inventory collection.
  • This blueprint is reusable, and you can also refer to it to create your own version, such as using particle effects instead of StaticMesh for visual representation.

Drop System

GIS provides two drop systems, each generating different types of PickupActor based on configuration.

  • All drop systems inherit from GIS_DropperComponent and can specify the generated PickupActorClass for drops.
  • Any Actor intended to be a pickup must implement the GIS_PickupActorInterface to be selectable in the DropperComponent.

1. Item Drop

  • Implementation:
    • Add GIS_ItemDropperComponent to enemies, NPCs, or scene objects (e.g., jars) that already have an inventory component.
    • Call the Drop function on the DropperComponent when the enemy/NPC dies or the jar breaks to generate pickups based on configured rules.
  • Configuration Options:
    • Which inventory collection to drop items from.
    • Drop type: InventoryPickup (single Actor, pick up all at once) or ItemPickup (multiple Actors, requiring individual pickups).
    • Random radius variation during drop and drop origin (can be the dropper's position or another Actor's position).

2. Currency Drop

  • Implementation:
    • Add GIS_CurrencyDropperComponent to an Actor.
    • Call the Drop function at the appropriate time to generate the corresponding currency pickup Actor.

Custom Extensions

  • The core functionalities and API interfaces of both pickup and drop systems are encapsulated in component form.
  • Developers can inherit from GIS_DropperComponent and GIS_PickupComponent via Blueprint or C++ and explore inheritable options to implement custom drop or pickup types.


logo_small
YuewuDev

© Yuewu @2025. All rights reserved.