Hey… So i was porting my project to UE4 4.6 , I Changed all my classes constructors so they match the new method as well GENERATED_UCLASS_BODY to GENERATED_BODY… it compiles fine up until it reaches a specific line in my AIController class
AIController header
#pragma once
#include "AIController.h"
#include "TTCustomerAIController.generated.h"
/**
*
*/
UCLASS()
class THETAVERN_API ATTCustomerAIController : public AAIController
{
GENERATED_BODY()
public:
ATTCustomerAIController(const FObjectInitializer& ObjectInitializer);
UPROPERTY(BlueprintReadOnly,Category = Controller)
class UTTableSphereVolume* CurrentTableSphere;
UPROPERTY(BlueprintReadOnly,Category = Controller)
class ATTCustomerCharacter* CPawn;
UPROPERTY()
class UBlackboardComponent* BlackboardComp;
UPROPERTY()
class UBehaviorTreeComponent* BehaviorComp;
UPROPERTY(BlueprintReadWrite,Category = Controller)
bool bHasSeat;
virtual void Possess(class APawn* InPawn) override; // this is the function
UPROPERTY()
bool bHasDrink;
UPROPERTY()
bool bIsDrinking;
UPROPERTY()
class UTTSeatComponent* CustomerSeat;
};
function where the error shows up
#include "TheTavern.h"
#include "TTCustomerCharacter.h"
#include "BehaviorTree/BlackboardComponent.h"
#include "BehaviorTree/BehaviorTree.h"
#include "BehaviorTree/BehaviorTreeComponent.h"
#include "TTCustomerAIController.h"
void ATTCustomerAIController::Possess(APawn* InPawn)
{
Super::Possess(InPawn);
ATTCustomerCharacter* Bot = Cast<ATTCustomerCharacter>(InPawn);
// start behavior
if (Bot && Bot->BotBehavior)
{
BlackboardComp->InitializeBlackboard(Bot->BotBehavior->BlackboardAsset);
BehaviorComp->StartTree(*(Bot->BotBehavior)); // Here!, Bot is the character pointer and BotBehavior is a pointer to UBehaviorTree
RunBehaviorTree(Bot->BotBehavior);
}
}
and the error itself is
error C2664: 'bool UBehaviorTreeComponent::StartTree(UBehaviorTree *,EBTExecutionMode::Type)' : cannot convert argument 1 from 'UBehaviorTree' to 'UBehaviorTree *'
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
I Even compared my code to the shootergame demo, it uses the exact same method and yet it actually fails to compile on me with the same error
Any help is always appreciated