Ninja Bear Studio Plugins Help

First Steps with Ninja Inventory

This page guides you through the first steps for Ninja Inventory. Make sure to check the Inventory Setup instructions before continuing.

This page assumes that your project has access to the Gameplay Ability System, but a full GAS implementation is not required for this first inventory setup. If you are using Ninja G.A.S., the same concepts can transfer to other G.A.S. setups.

The following steps aim to provide an inventory owner with an initialized Inventory Manager, a default container, and a simple item stored in that container.

It is also recommended that your Gameplay Debugger is configured, so you can inspect the inventory state during gameplay.

Inventory Attributes

Ninja Inventory can use Gameplay Attributes for inventory-related gameplay values, such as capacity, weight, and wealth.

For this first setup, inventory attributes are optional. You can skip this section if your project does not need attribute-driven inventory behavior yet.

Add Inventory Attributes using Ninja G.A.S.

  1. Create a new Data Table for your Inventory Attributes, using AttributeMetaData as the table row structure.

  2. Download the Sample Initialization Data and use it as the table data.

  3. Create a new G.A.S. Setup Data Asset and add a new Default Attribute Set entry.

    You can do so by right-clicking an empty area in the Content Browser, then navigating to Ninja Bear StudioNinja G.A.S.G.A.S. Setup.

  4. Add the Ninja Inventory Attribute Set, NinjaInventoryAttributeSet, and the data table as the Attribute Table.

  5. Set the new GAS Setup Data to the character's Ability System Component.

Default Container

Containers define where items can be stored. For this first setup, we will create a simple default container using the Simple Layout, which is a position-based type of storage.

Create a Default Container

  1. Create a new Container Definition Data Asset in the Containers folder configured in the Asset Manager.

    You can do so by right-clicking an empty area in the Content Browser, then navigating to Ninja Bear StudioNinja InventoryContainer Definition.

  2. Name it Container_Backpack.

  3. Add Inventory.Container.Trait.Default and Inventory.Container.Type.Backpack as the Gameplay Tags that define and identify this container.

  4. Configure the Layout as a Simple Layout and set Slots to 12.

  5. Set the Priority to 10 so other high-priority containers can take precedence.

    Backpack Container

Simple Item

Items are defined via aggregation, through Item Fragments. For this first setup, we will create a simple stackable item that can be stored in a container and displayed in the user interface.

Create a Simple Item

  1. Create a new Item Definition Data Asset in the Items folder configured in the Asset Manager.

    You can do so by right-clicking an empty area in the Content Browser, then navigating to Ninja Bear StudioNinja InventoryItem Definition.

  2. Name it Ammo_Rifle, or another simple item name that fits your project.

  3. Add a Container Storage fragment so the item can be stored in inventory containers.

  4. Add a User Interface fragment, set the Display Name, Category, Description and Icon.

  5. Add a Stack fragment, set the Maximum Quantity to 900 and the Stack Limit to 90.

    Simple Item

Inventory Manager Component

The Inventory Manager Component owns the runtime inventory state. It should be added to the actor that represents the inventory owner. For players, this usually means one of these options:

  • Player State: The inventory should persist across pawn changes, respawns, or possession changes.

  • Player Pawn: The inventory belongs to the current pawn and can reset when the pawn changes.

Add the Inventory Manager Component

  1. Open the Player State or Player Pawn that should own the inventory.

  2. Add the Inventory Manager Component, NinjaInventoryManagerComponent.

    Add the Inventory Manager Component

    Header

    public: ANBSPlayerState(const FObjectInitializer& ObjectInitializer); private: /** Inventory Manager component. */ UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = "true")) TObjectPtr<UNinjaInventoryManagerComponent> InventoryManager;

    Implementation

    #include "Components/NinjaInventoryManagerComponent.h" ANBSPlayerState::ANBSPlayerState(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { InventoryManager = CreateDefaultSubobject<UNinjaInventoryManagerComponent>(TEXT("InventoryManager")); }
  3. Navigate to the Inventory Manager category in the Inventory Manager Component.

  4. Add the Container_Backpack asset to the list of Initial Containers.

  5. Add the Ammo_Rifle asset to the list of Initial Items.

  6. Add a new entry to the item's Initial Fragment Data.

  7. Select ItemFragment_StackAndQuantity as the Fragment Class.

  8. Select Stack Memory as the Memory and set the Stack Size to 30.

    Default Container and Item

Inventory System Interface

To avoid repeated component lookups, you can optionally have the Actor or Player State implement InventorySystemInterface, which is recommended.

Add the Inventory System Interface

  1. In your inventory owner (Actor or Player State), add the InventorySystemInterface.

  2. Implement the GetInventoryManager function so it returns the Inventory Manager Component.

    Add the Inventory System Interface

    Header

    // Ninja Bear Studio Inc., all rights reserved. #pragma once #include "CoreMinimal.h" #include "GameFramework/PlayerState.h" #include "Interfaces/InventorySystemInterface.h" #include "NBSPlayerState.generated.h" class UNinjaInventoryManagerComponent; UCLASS() class NBSTECH_API ANBSPlayerState : public APlayerState, public IInventorySystemInterface { GENERATED_BODY() public: ANBSPlayerState(const FObjectInitializer& ObjectInitializer); // -- Begin InventorySystem implementation virtual UNinjaInventoryManagerComponent* GetInventoryManager_Implementation() const override; // -- End InventorySystem implementation private: /** Inventory Manager component. */ UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = "true")) TObjectPtr<UNinjaInventoryManagerComponent> InventoryManager; };

    Implementation

    // Ninja Bear Studio Inc., all rights reserved. #include "GameFramework/NBSPlayerState.h" #include "Components/NinjaInventoryManagerComponent.h" ANBSPlayerState::ANBSPlayerState(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { InventoryManager = CreateDefaultSubobject<UNinjaInventoryManagerComponent>(TEXT("InventoryManager")); } UNinjaInventoryManagerComponent* ANBSPlayerState::GetInventoryManager_Implementation() const { return InventoryManager; }

Evaluating the Inventory State

After starting the game, you can use the Gameplay Debugger to confirm that the inventory was initialized correctly.

Inspect the Inventory with the Gameplay Debugger

  1. Start the game in Play-in-Editor.

  2. Open the Gameplay Debugger and expand the Inventory Category.

  3. Select the actor that owns the Inventory Manager Component, if not selected by default.

  4. Check that the Initialization State displays Initialized.

  5. Check that the Owner and Avatar correctly match your Blueprints.

  6. Check that the Data Source displays Initial Data.

  7. Check that the Backpack Container is correctly shown, with the proper amount of slots.

  8. Check that the simple item was properly stored in the container and has the correct stack size.

    Inventory Debugger

Next Steps

At this point, you have an inventory owner with an initialized Inventory Manager, a default container, and a simple item stored in that container.

From here, you can:

22 May 2026