GetBlackBoard crash on Spawned AIController

Hello,

I have some enemy characters with AI placed in my level. They operate perfectly fine when playing. If the player does something, I want to spawn more enemies. All of them use the same AIController.

however, when I attempt to spawn in the same character_BP, I get a crash.
GetBlackboardComponent()->SetValueAsVector is causing the crash, so I assume it’s a nullptr between the AIBehavior tree and the blackboard.(?)

Am I missing another step that needs to be done when spawning a Character \ AI ?
Why would this not be a problem with the placed actors?

**
void ASSCustomerAIController::BeginPlay()
{
Super::BeginPlay();

 if (AIBehavior != nullptr)
 {
 	RunBehaviorTree(AIBehavior);
	
 	GetBlackboardComponent()->SetValueAsVector(TEXT("StartLocation"), GetPawn()->GetActorLocation());

**

When is the Blackboard component spawned?

I’m not specifically spawning the blackboard component in c++.

In the character blueprint I set the AIBehavior I want the character to run, the behavior tree contains the link to the blackboard comp…which I thought SHOULD work, and does work just not for spawned enemies.

The header just has a the BT declared like this.

private:

UPROPERTY(EditAnywhere)
class UBehaviorTree* AIBehavior;

Just to be sure in the Pawn tab of your AI character/Pawn BP set this:
adad

Yes, it’s set to auto Possess AI = Placed in World or Spawned.

If I flip that to “Placed” , I don’t get the crash (but obviously that’s not to useful for me hah).

or if I comment out the line…

GetBlackboardComponent()->SetValueAsVector(TEXT(“StartLocation”), GetPawn()->GetActorLocation());

…but that line should work fine…and it does (when placed).