Ninja Bear Studio Plugins Help

Adding Items from Pickups

Items can be added to the inventory through actors placed in the world, typically representing loot, rewards, or interactable pickups.

While the Inventory system provides a ready-to-use base actor class (ANinjaInventoryPickupActor), the only requirement is that your actor implements the IInventoryPickupInterface.

The Inventory Manager provides a built-in function, AddItemsFromPickupActor, which can be used to extract and grant items from any actor that implements this interface. This ensures custom pickup actors remain fully compatible with the inventory system’s queuing, stacking, and placement logic.

This gives you full control over how pickups behave, while still benefiting from the Inventory system’s item lifecycle and automation.

Provided Pickup Actor

Adding Items from a Pickup Actor

  1. Create a new Actor that inherits from ANinjaInventoryPickupActor.

  2. Customize the actor visually and functionally using meshes, effects, audio, or any other components relevant to your game.

  3. In the actor's PickupItems array, define one or more default items that should be granted when the pickup is collected.

Custom Pickup Actor

If you'd like to build a custom pickup actor (e.g., for complex interactions, scripted behavior, or special effects), you can do so by implementing the IInventoryPickupInterface.

This allows you to define your own collection logic while still leveraging the Inventory system’s item creation, queuing, and placement handling.

Implementing a Custom Pickup Actor

  1. Create a new actor based on your desired class (e.g., derived from AActor or any custom base).

  2. Implement the IInventoryPickupInterface on your actor class.

  3. Add a property that stores an array of FInventoryDefaultItem entries. This defines the items that can be granted to the inventory.

  4. Implement the required interface functions:

    • GetPickupItemDefinitions: returns the current array of item definitions.

    • SetPickupItemDefinitions: allows updating the array programmatically.

  5. Implement your pickup logic. When ready to grant the items, call AddItemsFromPickupActor on the target's Inventory Manager.

Last modified: 26 July 2025