RealDocs

AAIController::ShouldSyncBlackboardWith

function AIModule Since 4.0
#include "AIController.h"
Access: public Specifiers: virtualconst

Description

Called by the Blackboard system to determine whether this controller permits data synchronization from another UBlackboardComponent. Override to implement team-level or hierarchy-based shared knowledge.

Caveats & Gotchas

  • The default implementation always returns false — blackboards are isolated unless you explicitly override this. Enabling sync means key writes on either side propagate to all synced components, which can create hard-to-trace feedback loops in BT tasks.
  • Sync only propagates keys that exist in both Blackboard assets with matching types. Mismatched or absent keys are silently skipped without any error or warning.

Signature

virtual bool ShouldSyncBlackboardWith(const UBlackboardComponent& OtherBlackboardComponent) const

Parameters

Name Type Description Default
OtherBlackboardComponent const UBlackboardComponent& The blackboard component from another controller requesting synchronization.

Return Type

bool

Example

Allow sync between controllers on the same team C++
bool AMyAIController::ShouldSyncBlackboardWith(const UBlackboardComponent& Other) const
{
	const AController* OtherController = Cast<AController>(Other.GetOwner());
	if (OtherController)
	{
		return GetGenericTeamId() == FGenericTeamId::GetTeamIdentifier(OtherController);
	}
	return false;
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.