UBehaviorTreeComponent::RequestBranchActivation
#include "BehaviorTree/BehaviorTreeComponent.h"
Access: public
Description
Requests that the branch guarded by the given decorator be activated, typically because the decorator's condition just started passing.
Caveats & Gotchas
- • Used for decorators with an observer abort mode of LowerPriority or Both, where a condition becoming true should interrupt whatever is currently running at a higher priority.
- • Setting bRequestEvenIfExecuting to true can cause an already-active branch to restart — only do this if nodes within it specifically need to re-initialize.
Signature
void RequestBranchActivation(const UBTDecorator& RequestedBy, const bool bRequestEvenIfExecuting); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| RequestedBy | const UBTDecorator& | Decorator whose branch should be activated. | — |
| bRequestEvenIfExecuting | const bool | If true, forces (re)activation even if the branch is already the active one; otherwise skipped when already executing. | — |
Return Type
void Example
Activate a branch when a decorator's condition starts passing C++
OwnerComp.RequestBranchActivation(*this, /*bRequestEvenIfExecuting=*/false); See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?