C++ BTService updating every Blackboard's value the same for every AI

I am using C++ BTService to update my BlackBoard values, but instead of updating its BlackBoard values it update every AI’s BlackBoard values.

When using Blueprints it workd fine!

I’m not using instance synced values.

Code:

(.h)
I have function definitions and UPROPERTY(EditAnywhere) FBlackboardKeySelector variables.

(.cpp)

void UMonitorAIController::TickNode(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, float DeltaSeconds)
{
	Super::TickNode(OwnerComp, NodeMemory, DeltaSeconds);

	AAIGuardControllerBase* AIController = GetAIGuardControllerBase(OwnerComp.GetAIOwner());
	UBlackboardComponent* BlackboardComp = OwnerComp.GetBlackboardComponent();

	BlackboardComp->SetValueAsBool(bool_IsDistracted.SelectedKeyName,  AIController->IsDistracted());
}

Hi! Can you share code that is used?

Code added!

Hi again. You wrote that you want to update value for only one actor and not all others. How do you
distinguish the one that need update from others that dont need update? In general, services are running on each AI.

Hey! I think u misunderstood my question.
My C++ BTService is updating every BlackBoard’s value with the same one.

Example:
If 1 have say 5 AI’s with values set to false, with same BehaviorTree that are using this this BTService.
If one AI’s value changes to true (while others remains false), the BTService updates its BlackBoard value + it also updates every other (4 in this case) Blackboard values too (which are different).

When using Blueprints, it works fine.

I printed AI Controller’s name from both BP and C++ BTServices.

The Blueprint-BTService prints every aicontroller’s name but C++ BTService is only printing 1 controller’s name.

Hi! Can you check it on new default pawn, new service, new beh tree and new blackboard? Is there something specific in your configuration?

Ok, so check it on new and empty things, because I just checked it on my Engine version(4.23) and it was allright.

I don’t know if I am making some mistake or its UE4.

Both of my BTServices (BP and C++) are identical.

I was storing a reference to my AIController to prevent casting every time, and that for some reason caused this whole issue.