class has no member name

i'm using ue4 and i keep getting this problem with the class "AAI_Character" has no member "BehaviorTree" but i included every file i need
.cpp
#include "AI_Controller.h"
#include "BehaviorTree/BehaviorTree.h"
#include "BehaviorTree/BehaviorTreeComponent.h"
#include "BehaviorTree/BlackboardComponent.h"
#include "AI_Character.h"


void AAI_Controller::Possess(APawn * InPawn)
{
Super::Possess(InPawn);

AAI_Character *zombiebot = Cast<AAI_Character>(InPawn);
if (zombiebot)
{
if (zombiebot->BehaviorTree->BlackboardAsset)
{

}
}
}

AAI_Controller::AAI_Controller()
{
BehaviorComp = CreateDefaultSubobject<UBehaviorTreeComponent>(TEXT("BehaviorComp"));
BlackboardComp = CreateDefaultSubobject< UBlackboardComponent>(TEXT("blackboardcomp"));


}
.h
#include "CoreMinimal.h"
#include "AIController.h"
#include "AI_Controller.generated.h"

/**
*
*/
UCLASS()
class PROJECTX_API AAI_Controller : public AAIController
{
GENERATED_BODY()

virtual void Possess(class APawn* InPawn) override;

UPROPERTY(transient)
class UBehaviorTreeComponent* BehaviorComp;

UPROPERTY(transient)
class UBlackboardComponent* BlackboardComp;

AAI_Controller();



};


Last edited on
Have you looked at the definition of AI_Character to check that it does, indeed, have a member called BehaviorTree? Because from those header files, BehaviorTree looks more like the name of a type, rather than the name of a member.
thank you that did the trick
You're welcome.
Topic archived. No new replies allowed.