I’m trying to set my behavior tree in my AI Controller using C++ with the following code:
ShooterController.h
UPROPERTY( )
class UBehaviorTree* BehaviorTree;
ShooterController.cpp
static ConstructorHelpers::FClassFinder< UBehaviorTree > ShooterBehaviorTreeReference(
TEXT( "BehaviorTree'/Game/AI/ShooterBehaviorTree.ShooterBehaviorTree_C'" ) );
BehaviorTree = ShooterBehaviorTreeReference.Class.GetDefaultObject( );
The problem is that the Constructor Helper is failing to find the Behavior Tree Blueprint. I get the following error pop-up when I start the editor.
Default Property warnings and errors:
Error: CDO Constructor (VShooterController): Failed to find /Game/AI/ShooterBehaviorTree.ShooterBehaviorTree_C
Am I using the FClassFinder incorrectly?