Hello everyone.
I’m following the Unreal Engine 5 C++ course on udemy and I’m programming the AI part: BehaviorTree and BlackBoard.
I declared a UBehaviorTree inside my .h file, then I set it in the BP of the AIController class, but my project cannot find it!
.h file where I declared BehaviorTree:
private:
UPROPERTY(EditAnywhere)
class UBehaviorTree* AIBehavior;
.cpp file BeginPlay:
void APokemonAIController::BeginPlay()
{
Super::BeginPlay();
if (AIBehavior != nullptr) {
RunBehaviorTree(AIBehavior);
UE_LOG(LogTemp, Warning, TEXT("AIBehavior not Empty!"));
} else {
UE_LOG(LogTemp, Warning, TEXT("AIBehavior Empty!"));
}
}
BP AIController:
Pawn’s BP where the AIController is sets:
But my log always says that the AIBehavior is empty: