derkork / godot-statecharts

A state charts extension for Godot 4
MIT License
734 stars 35 forks source link

How to handle the Guard dependency of parallel state? #45

Closed ODtian closed 10 months ago

ODtian commented 10 months ago

Suppose parallel state A and B, they recive "event_a" and "event_b" which both bind to a same godot action (like a click), if i only want to transit from B, how should I do?

In my real case, event_a is always called earlier than event_b, which make a StateIsActive guard on state A watching state B is useless, because transition guard of state A can't see whether B has changed because it always evaluate it before event_b send to B. Do we need some code to sync the state?

ODtian commented 10 months ago

seems like not an issue of this addon, the solution is using _unhandled_input to ignore ui inputs which in my case event_a will not be triggered, godot docs has a good reference of how input event are handled in order.