How to set a blackboard value from controller?

Hey all!

I have a class which inherits from AAIController, which runs a behavior tree when it begins to play. I want to be able to manipulate values of the tree’s blackboard component. So I thought I could use the BrainComponent of the controller, but regardless what variable or method I try to access from it, I get a “pointer-to-incomplete” error:

AAIController* Controller = Cast<AAIController>(Member->Controller);
    if (Controller && Controller->BrainComponent)

How can I avoid this error, or shouldn’t I do it like that at all?


Thank you that solved it!

I think You need to include one of these headers in your cpp file:

#include "BehaviorTree/BlackboardComponent.h"
#include "BehaviorTree/BehaviorTree.h"