- Create an ActorComponent subclass using the engine called InventoryComponent:
![](/api/v2/epubs/9781789809503/files/assets/6a88aa60-de6e-48da-9a0b-df939365bc5f.png)
- Inside of the InventoryComponent.h file, add the following code:
#pragma once#include "CoreMinimal.h"#include "Components/ActorComponent.h"#include "InventoryComponent.generated.h"UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )class CHAPTER_04_API UInventoryComponent : public UActorComponent{ GENERATED_BODY()public: // Sets default values for this component's properties UInventoryComponent(); UPROPERTY() TArray<AInventoryActor*> CurrentInventory; UFUNCTION() int32 AddToInventory(AInventoryActor* ActorToAdd); UFUNCTION() void ...