State Trees and transition on completion

I want to start a discussion about the way state trees work.

If I have a node that has a transition on completion the transition does not take place if the success state is set by Enter State. Any thoughts on this - is it a bug or am I not understanding the way State trees work.

The example shows a simple state tree and a minimalist function that just prints a string and reports success - on running the tree it gets stuck in the Hello state rather than transitioning to the exit state. (confirmed using visual logger). This would seem to me to be incorrect behaviour.


Yeh I think this is a bug. From my experience and the very few examples of State Tree tutorials on youtube the Succeeded flag wont work like this.

What you can do to get around this is create a “completed” bool that you set to true after the print string. Then override the ontick function and check for when this is set to true using a branch. Connect the True pin to the exit node set to “Succeeded”. It should now work.

I assume / hope they will fix this soon

1 Like

There is a workaround documented here. [Bug?] State Tree stuck on "Debug Text Task"

This bug is reported fixed in 5.2

We’re still having issues with State Tree transitions not properly reaching the new state.

I try State Trees yesterday and all works fine, today i open my project and the AI doesn’t work :face_in_clouds:

I’ve had that a couple of times - cooking the project cleared it. Could you try that and see if it solves it?

I am still experiencing this bug on 5.2. I’m reporting a success in the task’s on tick, I’ve confirmed it’s firing, but the state will not advance to the next state. It instead calls the task repeatidly.

1 Like

Hum - then use the work around I posted - I’m working on something other than state trees at the moment but will do some tests when I clear that.