Description

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

Steps to Reproduce

  1. Create a behavior tree with the following setup:
    1. A Run Behavior node that executes a subtree.
    2. Attach a ForceSuccess decorator to the RunBehavior node.
    3. Attach an abort decorator (e.g., Blackboard Based Condition) to the same RunBehavior node.
  2. Trigger the condition that causes the abort decorator to abort the subtree.
    1. Change the value of the observed BB key if using Blackboard decorator
  3. Observe the result of the RunBehavior node.

Sample Tree:

[Image Removed]

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-235314 in the post.

0
Login to Vote

Fixed
ComponentUE - AI - BehaviorTree
Affects Versions5.45.5
Target Fix5.6
Fix Commit39455252
CreatedDec 20, 2024
ResolvedJan 24, 2025
UpdatedJan 25, 2025
View Jira Issue