From workflows
Builds NPC AI in Unreal Engine 5 with Behavior Trees and Blackboards: composites, tasks, decorators, services, and AIController.
How this skill is triggered — by the user, by Claude, or both
Slash command
/workflows:unreal-behavior-treesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Author NPC decision-making in UE5 with Behavior Trees driven by a Blackboard: structure the
Author NPC decision-making in UE5 with Behavior Trees driven by a Blackboard: structure the tree with composites, gate branches with decorators, keep state current with services, and run it from an AIController. Targets UE 5.4+.
BT_/BB_ asset pair, structuring
Selector/Sequence branches, adding decorators (conditions) and services (periodic updates),
writing custom BTTask/BTService nodes, or wiring an AIController to run the tree.BT_) and Blackboard (BB_) assets and an
AAIController.When not to use: the concept of AI (FSM vs BT vs steering, cross-engine) →
game-ai. Pure navigation/pathing math is engine navmesh (BT's MoveTo uses it). Simple
one-off logic may be cheaper as a small state machine than a full tree.
BB_) holds typed keys (the AI's memory: TargetActor,
LastKnownLocation, bIsInvestigating); a Behavior Tree (BT_) references that Blackboard.AAIController possesses the pawn and calls RunBehaviorTree(BT),
which also initializes the referenced Blackboard.TargetActor via a sight check) only while that branch is active.Succeeded, Failed, or InProgress (latent tasks like
MoveTo finish later).void AEnemyAIController::OnPossess(APawn* InPawn)
{
Super::OnPossess(InPawn);
if (BehaviorTree) // UPROPERTY(EditAnywhere) TObjectPtr<UBehaviorTree>
RunBehaviorTree(BehaviorTree); // initializes & uses the Blackboard the BT references
}
ROOT
└── Selector (try combat, else investigate, else patrol)
├── Sequence [Decorator: Blackboard 'TargetActor' Is Set, Observer Aborts: Both]
│ ├── Task: MoveTo (TargetActor) // latent: returns InProgress then Succeeded
│ └── Task: Attack
├── Sequence [Decorator: 'LastKnownLocation' Is Set]
│ ├── Task: MoveTo (LastKnownLocation)
│ └── Task: Wait (3s) + clear key
└── Task: Patrol (BTTask_FindPatrolPoint -> MoveTo)
Observer Aborts: Both makes the combat branch interrupt patrol the instant TargetActor is
set, and bail out when it's cleared — this is what makes the AI feel reactive.
void AEnemyAIController::SetTarget(AActor* Target)
{
if (UBlackboardComponent* BB = GetBlackboardComponent())
BB->SetValueAsObject(TEXT("TargetActor"), Target); // key name must match the BB asset
}
// Clear with BB->ClearValue(TEXT("TargetActor")); to drop back to a lower-priority branch.
RunBehaviorTree was never called.MoveTo instantly fails — no NavMesh in the level (add a Nav Mesh Bounds Volume), or the
target is off the navmesh.InProgress and never calls
FinishLatentTask. Always complete latent tasks.SetValueAsObject("Taget", ...) silently does nothing; match the
key name and type exactly, or use a cached FBlackboardKeySelector.UBTTaskNode (instant and latent ExecuteTask returning EBTNodeResult,
with a FBlackboardKeySelector), read references/custom-bttask.md.https://dev.epicgames.com/documentation/en-us/unreal-engine/behavior-trees-in-unreal-engine).game-ai — engine-agnostic AI design (FSM, BT, steering, pathfinding choices).unreal-cpp-gameplay — the AIController and pawn classes in C++.fps-shooter / tower-defense — genres that compose enemy AI.npx claudepluginhub gamedev-skills/awesome-gamedev-agent-skills --plugin gamedevImplements AI and navigation in Unreal Engine: AIController, behavior trees, blackboards, perception, NavMesh, EQS, State Tree, and Smart Objects.
Builds modular, debuggable AI behaviors using behavior trees for game NPCs and agents. Guides on tree design, blackboards, performance, and LLM integration.
Implements behavior trees in Godot using the Beehave addon (GDScript-only). Covers composites, decorators, leaves, blackboard, and visual debugger.