Navigation
Unreal Engine C++ API Reference > Runtime > AIModule > BehaviorTree
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UBTNode
- UBTTaskNode
- UBTTask_BlackboardBase
- UBTTask_MoveTo
- UBTTask_MoveDirectlyToward
- UBTTask_RotateToFaceBBEntry
- UBTTask_RunEQSQuery
- UBTTask_BlueprintBase
- UBTTask_FindAndUseGameplayBehaviorSmartObject
- UBTTask_FinishWithResult
- UBTTask_GameplayTaskBase
- UBTTask_MakeNoise
- UBTTask_PawnActionBase
- UBTTask_PushPawnAction
- UBTTask_PlayAnimation
- UBTTask_PlaySound
- UBTTask_RunBehavior
- UBTTask_RunBehaviorDynamic
- UBTTask_SetTagCooldown
- UBTTask_StopGameplayBehavior
- UBTTask_Wait
- UBTTask_WaitBlackboardTime
- UTestBTTask_BTStopAction
- UTestBTTask_LatentWithFlags
- UTestBTTask_Log
- UTestBTTask_SetFlag
- UTestBTTask_SetValue
- UTestBTTask_ToggleFlag
References
Module | AIModule |
Header | /Engine/Source/Runtime/AIModule/Classes/BehaviorTree/BTTaskNode.h |
Include | #include "BehaviorTree/BTTaskNode.h" |
Syntax
class UBTTaskNode : public UBTNode
Remarks
Task are leaf nodes of behavior tree, which perform actual actions
Because some of them can be instanced for specific AI, following virtual functions are not marked as const:
- ExecuteTask
- AbortTask
- TickTask
- OnMessage
If your node is not being instanced (default behavior), DO NOT change any properties of object within those functions! Template nodes are shared across all behavior tree components using the same tree asset and must store their runtime properties in provided NodeMemory block (allocation size determined by GetInstanceMemorySize() )
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
uint32: 1 | bIgnoreRestartSelf | If set, task search will be discarded when this task is selected to execute but is already running |
![]() |
uint32: 1 | bNotifyTaskFinished | If set, OnTaskFinished will be called |
![]() |
uint32: 1 | bNotifyTick | If set, TickTask will be called |
![]() |
uint8: 1 | bTickIntervals | If set, conditional tick will use remaining time from node's memory |
![]() |
TArray< TObjectPtr< UBTService > > | Services | Service nodes |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
UBTTaskNode
(
const FObjectInitializer& ObjectInitializer |
Functions
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
EBTNodeResult::Type | AbortTask
(
UBehaviorTreeComponent& OwnerComp, |
Aborts this task, should return Aborted or InProgress (use FinishLatentAbort() when returning InProgress) this function should be considered as const (don't modify state of object) if node is not instanced! |
![]() ![]() |
EBTNodeResult::Type | ExecuteTask
(
UBehaviorTreeComponent& OwnerComp, |
Starts this task, should return Succeeded, Failed or InProgress (use FinishLatentTask() when returning InProgress) this function should be considered as const (don't modify state of object) if node is not instanced! |
![]() ![]() |
void | FinishLatentAbort
(
UBehaviorTreeComponent& OwnerComp |
Helper function: finishes latent aborting |
![]() ![]() |
void | FinishLatentTask
(
UBehaviorTreeComponent& OwnerComp, |
Helper function: finish latent executing |
![]() |
void | ||
![]() ![]() |
void | OnMessage
(
UBehaviorTreeComponent& OwnerComp, |
Message handler, default implementation will finish latent execution/abortion this function should be considered as const (don't modify state of object) if node is not instanced! |
![]() ![]() |
void | OnTaskFinished
(
UBehaviorTreeComponent& OwnerComp, |
Called when task execution is finished this function should be considered as const (don't modify state of object) if node is not instanced! bNotifyTaskFinished must be set to true for this function to be called Calling INIT_TASK_NODE_NOTIFY_FLAGS in the constructor of the task will set this flag automatically |
![]() |
void | ReceivedMessage
(
UBrainComponent* BrainComp, |
Message observer's hook |
![]() ![]() |
void | SetNextTickTime
(
uint8* NodeMemory, |
Sets next tick time |
![]() ![]() |
bool | ||
![]() ![]() |
void | StopWaitingForMessages
(
UBehaviorTreeComponent& OwnerComp |
Unregister message observers |
![]() ![]() |
void | TickTask
(
UBehaviorTreeComponent& OwnerComp, |
Ticks this task this function should be considered as const (don't modify state of object) if node is not instanced! bNotifyTick must be set to true for this function to be called Calling INIT_TASK_NODE_NOTIFY_FLAGS in the constructor of the task will set this flag automatically |
![]() ![]() |
void | WaitForMessage
(
UBehaviorTreeComponent& OwnerComp, |
Register message observer |
![]() ![]() |
void | WaitForMessage
(
UBehaviorTreeComponent& OwnerComp, |
Register message observer |
![]() ![]() |
EBTNodeResult::Type | WrappedAbortTask
(
UBehaviorTreeComponent& OwnerComp, |
Wrapper for node instancing: AbortTask |
![]() ![]() |
EBTNodeResult::Type | WrappedExecuteTask
(
UBehaviorTreeComponent& OwnerComp, |
Wrapper for node instancing: ExecuteTask |
![]() ![]() |
void | WrappedOnTaskFinished
(
UBehaviorTreeComponent& OwnerComp, |
Wrapper for node instancing: OnTaskFinished |
![]() ![]() |
bool | WrappedTickTask
(
UBehaviorTreeComponent& OwnerComp, |
Wrapper for node instancing: TickTask |
Overridden from UBTNode
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
FName | Get the name of the icon used to display this node in the editor | |
![]() ![]() ![]() |
uint16 | Size of special, hidden memory block for internal mechanics |
Overridden from IGameplayTaskOwnerInterface
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | OnGameplayTaskDeactivated
(
UGameplayTask& Task |
Notify called after GameplayTask changes state from Active (finishing or pausing) |