Good day it is the first time I post something in the forums but I have been trying for hours to resolve this issue but I can’t find anything working. I want to create a behavior tree in unreal engine 4.3. So I have added AIModule to the project.build.cs file since before that it would state that the superclass did not exist. However after this I got a few errors and I don’t know what’s causing them.
Code:
#pragma once
#include "AIController.h"
#include "TutorialAIController.generated.h"
/**
*
*/
UCLASS(config = Game)
class AIPROJECT_API ATutorialAIController : public AAIController
{
GENERATED_UCLASS_BODY()
UPROPERTY(transient)
TSubobjectPtr<class UBlackboardComponent> BlackboardComp;
UPROPERTY(transient)
TSubobjectPtr<class UBehaviorTreeComponent> BehaviorComp;
virtual void Possess(class APawn* InPawn) override;
virtual void BeginInactiveState() override;
void SetEnemy(class APawn* InPawn);
UFUNCTION(BlueprintCallable, Category = Behavior)
void FindClosestEnemy();
virtual void UpdateControlRotation(float DeltaTime, bool bUpdatePawn = true) override;
protected:
int32 EnemyKeyID;
int32 EnemyLocationID;
};
and I get these errors
Error 2 error C2439: ‘TSubobjectPtrConstructor::Object’ : member could not be initialized
Error 1 error C2440: ‘initializing’ : cannot convert from ‘UBlackboardComponent *’ to ‘UObject *’
Error 3 error : Failed to produce item
Please help me guys and gals, I am quite confused right now !