UMoveAwayFromActor
Overview
UMoveAwayFromActor is a custom Behavior Tree task node designed to make an AI controller move away from a target actor. It inherits from UBTTaskNode and utilizes the Blackboard component to retrieve the target actor's location. The AI then calculates a new location that is a specified distance away from the target, ensuring it remains within navigable areas.
Properties
Type | Name | Access | Description |
|---|---|---|---|
FBlackboardKeySelector | TargetActor | EditAnywhere | Blackboard key selector for the target actor. |
TObjectPtr | Actor | Private | Cached reference to the target actor. |
float | Radius | EditAnywhere | Distance from the AI to the target actor. |
Functions
Return Type | Signature | Description |
|---|---|---|
EBTNodeResult::Type | ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory) override | Executes the task logic to make the AI move away from the target actor. |
Usage & Implementation Notes
Threading Constraints: This task should be executed on the game thread.
Replication Requirements: None.
Memory Lifetime Management: The
Actorproperty is cached and reused within the same instance of the task node.Initialization Dependencies: Requires a valid AI controller with a Blackboard component and a navigation system.