Hello, I’ve recently started messing around with State Trees, I was trying to implement a common example I’ve done many times with BTs which consists in:
- Agent Finds random position
- Agent moves to the found position
- Agent Waits X seconds
However I’ve come across two different situations in State Trees where the placement of the “Wait State” that runs the “Delay Task” seems to change the execution of the delay task.
In the following image, the behavior works as expected, the agent waits, finds a position and moves to that position.
However, if I place the “Wait Delay” state, below the “Find Position” state, which contains a task, it no longer works.
I created my own Wait task to see what was happening, my task blueprint simply executed a delay node. I replaced the default Delay Task with my custom one, but the behavior remained was the same.
When the “Wait Delay” was placed below the “Find Position” State, it would just spam the output log with the first print on my custom task, never actually finishing the delay and breaking the State Tree.
I’ve read the State Tree Overview Documentation many times at this point and didn’t read anything that would cause this issue.
The documentation actually shows a similar setup with smart objects, and explains the following:
" StateTree comes with the Next Transition, which simplifies creating and arranging a sequence of States.
In the example above, when the Reach State is selected, the Find SO Target, Move to SO, and Look Tasks are executed. Once the Tasks are completed, the Next Transition moves execution to the Use State below, where its Tasks can begin executing."
So I guess my question is, is this Intended? Have I encountered a bug? I’m failing to understand why this could be the intended behavior, any insight would be appreciated.