You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It took me a while to reproduce but I found out that some architecture can trigger on_enter and on_exit twice.
Small explanation of my nodes :
I have a character that move in the Move state, then once I click it goes into Jump state and immediatly transition to a Falling state.
I've connected the on_enter() function of the Move and Falling state to a function that print respectively Move and Falling enter with the timestamp.
With this setup :
Produce this result :
However this architecture :
Airborne also print its name on enter
Produce this result :
During transition, it seems that compoundstate trigger the on_enter() and on_exit of his children if it's the target node. I've looked into the reference statechart.io website to see if it's an intended behavior, but didn't find any. I believe this is unintended behavior.
However I'm not familiar enough with the code to know why the root compoundstate isn't affected.
Thank you
The text was updated successfully, but these errors were encountered:
Hey Remi123, thanks a lot for reporting this. It is indeed not intended behaviour. The "Airborne" state will activate it's default child state when entered. However since this is part of a transition it actually should not do this. I have added a fix for this and will release an update with it. I have also added some improvements to the state chart debugger so it can track state change events for you without you having to litter your code with print statements:
In the screenshot you can now also see the fixed behaviour, when AA transitions to ABA , ABA will only be activated once.
It took me a while to reproduce but I found out that some architecture can trigger on_enter and on_exit twice.
Small explanation of my nodes :
I have a character that move in the Move state, then once I click it goes into Jump state and immediatly transition to a Falling state.
I've connected the
on_enter()
function of the Move and Falling state to a function that print respectivelyMove
andFalling enter
with the timestamp.With this setup :
Produce this result :
However this architecture :
Airborne also print its name on enter
Produce this result :
During transition, it seems that compoundstate trigger the on_enter() and on_exit of his children if it's the target node. I've looked into the reference statechart.io website to see if it's an intended behavior, but didn't find any. I believe this is unintended behavior.
However I'm not familiar enough with the code to know why the root compoundstate isn't affected.
Thank you
The text was updated successfully, but these errors were encountered: