llms.txt: machine-readable documentation index. Markdown version of this page is also available.

Ninja Bear Studio Plugins Help

Interaction and Inventory: Collect an Item from an Interactable

Let a player walk over a bundle of five bandages. Ninja Interaction decides when collection starts. Ninja Inventory decides how many fit. The same transfer also works for a focused pickup that the player collects with a button.

Make the Collect slot grant bandages

  1. Start with a character with an inventory and an actor with an immediate Collect slot. The actor implements the Interaction Target Interface and has an Interaction Target Component. Add a Ninja Inventory Pickup Component to that actor. Set Item Source to Initial Items and add five stackable bandages under Pickup Items.

  2. Bind the Target Component's OnInteractionFinished. Check for Interaction.Type.Collect. On the authority branch, call GetPawn on the event's source Interaction Manager and pass that pawn to TryGrantItems on the pickup component. For walk-over collection, the overlap starts the interaction and the finish callback performs the transfer.

  3. Enable Destroy Owner When Fully Consumed, or bind OnFullyConsumed to disable the slot and play a collection effect. Leave Interaction.Trait.Disposable off so the player can return for the remainder. Finishing the interaction tells you the player reached the pickup. Inventory's result tells you what they received.

Show How Many the Player Collected

For a message such as Collected 2 bandages, use ConsumedAmount and SourceIndex from each pickup result. In a C++ pickup component, override HandlePickupResults_Implementation and call Super::HandlePickupResults_Implementation(Results) once so the component deducts the accepted quantities. In Blueprint, an actor implementing the Inventory Pickup Interface can forward HandlePickupResults to its pickup component and read the same results. Use OnFullyConsumed for the final disappearance. Give a Pickup Its Own Behavior explains how Inventory finds the pickup implementation.

Try It in Play

Collect all five bandages with space available. The bag should gain five and the pickup should disappear or become unavailable. Try a fresh bundle with room for only two in an existing stack and no empty slots. Expect two in the bag and three left in the world. Try again with the bag full, then free space and re-enter range. The last collection should grant exactly three. If cancelling a focused interaction also grants items, check that only the finish event calls TryGrantItems.

25 November 2026