I have an AIController subclass named AEnemyAIController with the following members in the header:
UPROPERTY(Transient)
class UBlackboardComponent *BlackboardComp;
UPROPERTY(Transient)
class UBehaviorTreeComponent *BehaviorComp;
Both classes feature the following forward class references in the header:
class UBlackboardComponent;
class UBehaviorTreeComponent;
And the .cpp file features the following include macros, in addition to the ones for the header and other referenced custom classes:
#include "BehaviorTree/BlackboardData.h"
#include "BehaviorTree/BlackboardComponent.h"
#include "BehaviorTree/BehaviorTreeComponent.h"
#include "BehaviorTree/BehaviorTree.h"
In its implementation of Possess(), it features the following code:
AEnemyBotCharacter *Bot = Cast<AEnemyBotCharacter>(InPawn);
if (Bot && Bot->BotBehavior)
{
UBlackboardData *BlackboardData = Bot->BotBehavior->BlackboardAsset;
BlackboardComp->InitializeBlackboard(BlackboardData);
}
All of the above worked as expected in UE 4.6.1, but upgrading the project to UE 4.7 with no changes to the code results in the following error:
error: non-const lvalue reference to type 'UBlackboardData' cannot bind to a value of unrelated type 'UBlackboardData *'
Either the program somehow does not know what UBlackboardData is (which would likely be due to using the wrong include macro when attempting to reference the relevant code, with the include macro being #include “BehaviorTree/BlackboardData.h”), I’m handling pointers wrong, the engine code has changed some of its pointer handling, or it’s something else entirely. What could be the cause of the same code being broken in UE 4.7 despite working perfectly and as expected in UE 4.6.1?