UBTTaskNode::WrappedExecuteTask
#include "BehaviorTree/BTTaskNode.h"
Access: public
Specifiers: const
Description
Internal wrapper the behavior tree runtime calls instead of ExecuteTask directly, so that instanced nodes resolve to the correct object before executing. It is what actually gets invoked when a task is selected to run.
Caveats & Gotchas
- • Marked const because the wrapper itself doesn't mutate state — but it may call a non-const ExecuteTask override on an instanced node.
- • Not intended to be called from game code or overridden; override ExecuteTask instead.
- • For non-instanced (template) nodes, ExecuteTask must be treated as logically const since the same node object is shared across all AI using that tree.
Signature
EBTNodeResult::Type WrappedExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| OwnerComp | UBehaviorTreeComponent& | The behavior tree component driving execution. | — |
| NodeMemory | uint8* | Pointer to this node's instance memory block. | — |
Return Type
EBTNodeResult::Type Example
Override the underlying task instead C++
EBTNodeResult::Type UMyTask::ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory)
{
// Called via WrappedExecuteTask() by the BT runtime
return EBTNodeResult::Succeeded;
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?