Help me understand State Tree transitions

Trying to learn the State Tree system and trying to understand how the transition logic works. I read the introduction to the State Trees and I gathered that when a state is selected, all the parent states are also active and when a transition is triggered, the new state will become active, along with its respective parent states.

I have made a simple debugging tree.

st1

My expectation would be that i would see State 1a and its parent (State 1) running, then it would transition to State 1b (and State 1 as its parent), then to State 2.

However it seems to be stuck in State 1a and I don’t know why.

Any insights? :slight_smile:

Update:

I am looking into visual debugger and I captured some gameplay with it.
Apparently my state tree “could not trigger completion transition” and jumps back to start.

This was maybe because “State 1” didn’t have a transition.
So I added one.

st6

It’s slightly different now, but doesn’t solve my problem. :<

Still not sure why ^^;;;

Update once more:

Soooo, the task that I used on all states was printing a string and then ending with a “Finish Task” node (set on success).

That may have been the problem… in some way that I dont yet fully understand.

Anyway, removing the task from State 1 solved my problem.

st7

Now it runs through the tree like I wanted it too.


As it is close to midnight, I will call it a day and try to understand it another day.
If anyone can elaborate or throw their knowledge at me, that would be welcome. :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.