How to initialize UBehaviourTreeComponent in C++?

I’m just trying to setup and initialize UBehaviourTreeComponent in C++, but it keeps giving me errors when I compile it. What exactly is wrong with it? Here’s the code I have:

header

#pragma once

#include "GameFramework/AIController.h"
#include "TigerController.generated.h"

/**
 * 
 */
UCLASS()
class ATigerController : public AAIController
{
	GENERATED_UCLASS_BODY()

	UPROPERTY(transient)
	TSubobjectPtr<class UBlackboardComponent> BlackboardComponent;

	UPROPERTY(transient)
	TSubobjectPtr<class UBehaviourTreeComponent> BehaviourTreeComp;

	virtual void Possess(class APawn* InPawn) OVERRIDE;
};

cpp

#include "Rawr.h"
#include "TigerController.h"


ATigerController::ATigerController(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)
{
	BlackboardComponent = PCIP.CreateDefaultSubobject<UBlackboardComponent>(this, TEXT("BlackboardComponent"));

	BehaviourTreeComp = PCIP.CreateDefaultSubobject<UBehaviorTreeComponent>(this, TEXT("BehaviourTreeComponent"));
}

void ATigerController::Possess(class APawn* InPawn)
{
	Super::Possess(InPawn);
}

Please, anyone?

Hi Danny-sama

Try adding the followings includes in your .h file before #include “TigerController.generated.h”

#include "BehaviorTree/BlackboardComponent.h"
#include "BehaviorTree/BehaviorTreeComponent.h"

Also, remember you need to add the AIModule in your PROJECT.Build.cs inside PublicDependencyModuleNames.AddRange

Regards