Error C2440: 'initializing' : cannot convert from 'UBlackboardComponent *' to 'UObject *'

Am getting this error:

error C2440: 'initializing' : cannot convert from 'UBlackboardComponent *' to 'UObject *'

For this line

BlackboardComp = PCIP.CreateDefaultSubobject<UBlackboardComponent>(this, TEXT("BlackboardComp"));

Worked on a tutorial i was watching so have i made a typo anywhere??

Show declaration of BlackboardComp from an header file.

UPROPERTY(transient)
TSubobjectPtr BlackboardComp;

No clue, the code looks the same as in ShooterGame, are you sure this the wrong line ?

Hi Green_,

Do you have the following line in your .h file?

#include "BehaviorTree/BlackboardComponent.h"

If you are following the tutorial I think you may be following, you will most likely also need to use

#include "BehaviorTree/BehaviorTreeComponent.h"

Also, you should be using Transient instead of transient. I believe that was changed recently.

Yep this fixed it, thank you. Why do i have to import these? Are they not included already?

In order to improve performance, the Engine no longer includes everything automatically. The more commonly used classes are still available, but you may find yourself needing to include specific header files occasionally.