UBlackboardComponent::IsCompatibleWith
#include "BehaviorTree/BlackboardComponent.h"
Access: public
Specifiers: virtualconst
Description
Returns true if the given blackboard data asset can be used with this component, meaning it matches or derives from the currently assigned asset.
Caveats & Gotchas
- • Compatibility checks walk the asset's parent chain, so a child BlackboardData asset is compatible with a component already using the parent asset.
- • Call this before InitializeBlackboard when swapping assets on an already-initialized component to avoid silently breaking key ID assumptions held by running behavior trees.
Signature
virtual bool IsCompatibleWith(const UBlackboardData* TestAsset) const Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| TestAsset | const UBlackboardData* | The candidate blackboard asset to test against the one currently in use. | — |
Return Type
bool Example
Guard an asset swap C++
if (BlackboardComp->IsCompatibleWith(NewAsset))
{
BlackboardComp->InitializeBlackboard(*NewAsset);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?