In our project, we built several State Tree tasks that could run in parent states and complete immediately following EnterState (for example, setting an AI Character’s movement mode or setting its gameplay focus).
In version 5.5, we made sure those tasks had the option to either return EStateTreeRunStatus::Succeeded or EStateTreeRunStatus::Running once the task was successfully completed. This feature was removed in version 5.6 due to the introduction of a new option to selectively mark which tasks are relevant for state completion.
As we updated our state tree tasks library in 5.6, we modified those tasks to now only return EStateTreeRunStatus::Succeeded, reflecting the new expectation that they could be correctly excluded from the state completion logic.
But, we noticed our State Trees are now skipping leaf states of a subtree if a State Tree task ends in the root state of the said subtree, even when this task is explicitly marked not to be considered for state completion. It doesn’t interrupt the behavior, but once the state completes, it searches for a transition at the parent frame instead of considering transitions from the leaf state. It doesn’t seem to be an issue with Linked Asset, or with regular States.
This issue appears to be linked to the StateTree.GlobalTasksCompleteOwningFrame console variable. Disabling it makes the setup work as intended. This issue seems to be similar to what is discussed in the following forum post: Forum Post
I’ve been able to reproduce the issue in a clean project, using the Third-Person Template. The state tree setup includes every use case I could think of, and highlights an issue with tasks in the root state of a subtree.
You can look in details at the state tree setup in ST_Main, and in the linked asset ST_Linked. (/All/Game/ThirdPerson/Blueprints/StateTree)
ST_Main
[Image Removed]
Notice that the Delay task in the State & Subtree have Toggle Completion set to false.
ST_Linked
[Image Removed]
Notice that the Delay task in the root state has Toggle Completion set to false.
Observations:
At runtime, we should sequentially observe the debug task displayed in the following order:
- State - State 1
- State - State 2
- Subtree - State 1
- Subtree - State 2
- Linked Asset - State 1
- Linked Asset - State 2
But despite the delay task in Subtree being explicitly toggled off for state completion, the execution is blocked, and Subtree >State 2 is never reached. This may be due to the delay task in the Subtree’s root incorrectly considering the transition to Tree Succeeded upon the task completion.
The issue doesn’t appear for similar setup using a Linked Asset, or a similar setup using only regular states.
This issue completly disappears when StateTree.GlobalTasksCompleteOwningFrame is set to false.
Furthermore, with the 5.5 behavior, toggling the delay task’s completion icon on correctly resulted in the state completing immediately upon task completion, whereas toggling it off allowed the leaf states to continue running as intended.
Could you please clarify if this transition behavior in UE 5.6 is by design, or if it constitutes a bug?
[Attachment Removed]