Save and Load
Saving the Inventory
To save an inventory, use the NinjaInventorySaveGame class. This class can serialize the Inventory Manager's properties, along with its Containers, Items, and their Fragment Memories.
Call the SaveInventory function (defined in the NinjaInventorySaveGame object) and pass the Inventory Manager you want to save. This function gathers the current inventory state and stores it in the Save Game Object, which can then be saved using Unreal Engine's standard save flow.
The following example will walk you through these general steps. It's done using a debug key in the Player Character blueprint, but you can perform the save operation wherever it is appropriate for your game.
Saving the Inventory

Retrieve and validate the Inventory Manager Component from your actor using
GetInventoryManager, available in the Inventory Blueprint Library.Create a Save Game Object using
NinjaInventorySaveGameas the Save Game Class.Call
SaveInventoryon the Save Game Object, passing in the Inventory Manager to be serialized.Perform an asynchronous save operation, providing the desired slot and user index.
Optionally track the result (e.g., print a message or update UI elements).
You can verify the generated save file using any tool, such as the Save File Editor, available on Fab.
Next, we'll look into the loading operation, which can be executed either automatically or manually.
Loading the Inventory
Once a saved inventory file exists, it can be loaded back into the Inventory Manager using the same base classes and functions used during saving.
The loading process can be performed either manually (e.g., triggered by the player or game logic) or automatically (during initialization). The example below demonstrates a manual approach using a debug key in the Player Character blueprint.
To load the data, you need to call the LoadInventory function from a NinjaInventorySaveGame object after successfully loading it from disk.
Loading the Inventory

Use
GetInventoryManagerto retrieve the Inventory Manager for the actor that should receive the inventory state.Validate the returned reference with
Is Valid. If it is not valid, skip the rest of the logic.Obtain the slot name and user index from the Inventory Manager using
Get Save Game Slot NameandGet Save Game User Index.Call
Async Load Game from Slot, passing in the slot name and user index retrieved above.Check the success of the operation, and cast the returned object to
NinjaInventorySaveGame.Call
LoadInventoryon the Save Game object, providing the Inventory Manager reference. This will apply the saved Containers, Items, and Fragment Memories to the manager.Optionally track the result (e.g., print a message or update UI elements).
Automatic Loading
The Inventory System also supports automatic loading of saved data, which can occur during the initialization of the Inventory Manager, without requiring any manual logic.
This behavior is controlled by the following Inventory Manager settings:
Property | Description |
|---|---|
| If enabled, the Inventory Manager will automatically attempt to load inventory data from disk when it is initialized. |
| The name of the slot to load from. This value is also used during save operations. You can retrieve it at runtime using |
| The user index to load from. You can override |
If a save file is present for the specified slot and index, the inventory will be automatically restored—no extra calls are needed. If the file is missing, the initialization happens normally, potentially loading default items as needed.
This setup is ideal for player inventories that should persist across sessions or respawns, without requiring explicit save/load Blueprint logic during gameplay.