When using the ForceSuccess decorator on a Run Behavior task which also has an abort decorator, the Force Success node cannot make the task return succeeded when the abort is triggered. This means that using the Run Behavior node in a sequence will stop the sequence from running rather than allowing the Run Behavior node to be used as an optional branch.
If the same two decorators run on another BT task that does not create a subtree, the behavior is that the sequence continues to the next node/branch within the sequence. It was expected that running on a node that has a subtree would have the same behavior. Debugging this showed that the NodeResult *is *Failed *inside of *UBTDecorator_ForceSuccess::OnNodeProcessed, but SearchData.SearchRootNode is using the root node of the main tree while the SearchData.RollbackInstanceIdx is set to the root of the subtree. This always sets bCanForceSuccess *to false so the decorator does not change the *NodeResult.
This applies to both Run Behavior and Run Behavior Dynamic nodes.
Steps to Reproduce
Sample Tree:
[Image Removed]
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-235314 in the post.
0 |
Component | UE - AI - BehaviorTree |
---|---|
Affects Versions | 5.4, 5.5 |
Target Fix | 5.6 |
Fix Commit | 39455252 |
---|
Created | Dec 20, 2024 |
---|---|
Resolved | Jan 24, 2025 |
Updated | Feb 10, 2025 |