Equipment Instances and States
Equipment Instances
When an eligible item is added to an Equipment Container, the Equipment Manager automatically creates an NinjaInventoryEquipment instance to represent its presence in the world. These instances are tracked and updated based on the item's state and container configuration.
Equipment Instances are used to drive the physical presence of an item - either for visuals, gameplay, or both. Equipment can be represented in two main ways:
Actor: For complex interactions, behaviors and multi-mesh representations.
Mesh: For simpler visual representation (static or skeletal mesh).
Mutable: You can use customizable objects to implement armor pieces and similar equipment types.
The chosen type is defined per Equipment State, allowing different representations depending on the item's current usage. For example: a weapon might be an Actor, with a skeletal mesh and dedicated animation while equipped, but a simple static mesh while stored.
Equipment Actors
When using actors for equipment:
There are no requirements on actor hierarchy (base classes or interfaces).
The actor must include a
NinjaEquipmentActorComponent.
This component receives a reference to the UNinjaInventoryEquipment instance that spawned it and provides support functions
to access the owning equipment and item, the equipment manager and the * inventory manager.
Custom Equipment Logic
You can subclass NinjaInventoryEquipment to implement custom logic and assign your subclass directly to the Equipment Fragment. This enables additional gameplay systems, data storage, and access to custom behavior per equipment instance.
Animation Blueprints
Equipment instances represented by Skeletal Meshes can receive an Animation Instance class to manage their animation. The Animation Instance can data from the equipment or avatar via the EquipmentAnimationInterface.
This interface provides two functions that allow the Animation Instance to receive the Equipment Instance and the Avatar Actor related to the inventory. Both functions are optional, so you only need to implement the one that is relevant to your scenario.
Equipment States
Equipment States define how each NinjaInventoryEquipment is represented in the world, based on the item's current equipment state tag.
These are configured in the Equipment Fragment and mapped using one or more FGameplayTags. Not all equipment states need to be represented visually - only those listed in the fragment will be created.
Each InventoryEquipmentState provides detailed control over how the item should appear or behave in a specific state.
Property | Description |
|---|---|
| All equipment state tags covered by this configuration. Multiple tags can share the same settings. |
| All prerequisites evaluated before an equipment state can be changed to |
| Determines if this state uses an |
| Actor class to spawn for this state (if type is |
| Static mesh to display for this state (if type is |
| Skeletal mesh to display for this state (if type is |
| Whether the skeletal mesh should follow the parent avatar’s mesh as a follower (leader pose). |
| Animation blueprint to use if the skeletal mesh is not using a leader pose. |
| If true, overrides the default Attach Parent Finder set in the Equipment Manager. |
| Custom |
| If true, overrides the socket defined in the Equipment Container. |
| Name of the socket to use when attaching the actor or mesh. |
| Linked Animation Graph added as a layer to the avatar's Animation Blueprint, while the state is active. |
| Attribute sets granted to the avatar while in this equipment state. |
| Gameplay Effects applied to the avatar when entering this state. |
| Additional containers granted while this state is active (e.g., ammo pouches or sheath slots). |
Changing States
The Inventory System provides the following options so you can change equipment state:
Equipment Fragment: Provides the
SetEquipmentStatefunction that can be used to update the item's equipment state.Equip Ability: Integrates the Equipment Fragment with Animations Montages and support for Gameplay Events.