-
-
Notifications
You must be signed in to change notification settings - Fork 8
How to Setup Inventory
Attach Inventory Manager to GameState used with GameMode.
In the protected section (this is not necessary, however, I suggest placing the Variable in the protected section) add this line:
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Inventory")
class UInventoryManagerComponent* InventoryManager = nullptr;
In C++ Constructor of your GameState class add those lines:
InventoryManager = CreateDefaultSubobject<UInventoryManagerComponent>(TEXT("InventoryManagerComponent"));
You will need to add header include in the top, where other includes are:
#include "Components/InventoryManagerComponent.h"
Adding a new Component in Blueprint is faster and easier.
Open your GameState class, select Add Component and find Inventory Manager Component.
Attach Inventory Component to PlayerController used with GameMode.
In the protected section (this is not necessary, however, I suggest placing the Variable in the protected section) add this line:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Inventory")
class UInventoryComponent* InventoryComponent = nullptr;
In C++ Constructor of your PlayerController class add those lines:
InventoryComponent = CreateDefaultSubobject<UInventoryComponent>(TEXT("InventoryComponent"));
You will need to add header include in the top, where other includes are:
#include "Components/InventoryComponent.h"
Adding a new Component in Blueprint is faster and easier.
Open your PlayerController class, select Add Component and find Inventory Component.
In order to make all Widgets work, there are two steps required.
You can use the provided GameState class which comes with the ActorInventoryPlugin to learn how to set up Widget Subclasses.
You can use the provided PlayerController which comes with the ActorInventoryPlugin to learn how to set up Player Controller showing/hiding widgets and storing pointers.
- Home
-
- Components
-
- Objects
-
- Settings
-
-
- Inventory & Equipment Settings
-
-
-
-
- Theme Config
-
-
-
-
-
-
- Content Theme Config
-
-
-
-
-
- Inventory & Equipment Settings (Editor)
-
- Event's System