Closed Red3Tango closed 1 year ago
I think this is caused by the recent change that ensures that state changes happen in the same frame. It could be fixed by delaying entering the initial state of the state chart by one frame, to ensure that the full tree is ready.
I'll build a new release with this change as i think this makes more sense than the current implementation but I will not be able to do it today. As a temporary workaround you can change this line in state_chart.gd
which should delay the state entering by one frame:
I always forget that call_deferred()
exists. Tested and can confirm this works.
Released 0.4.3 which has the fix built-in.
Using vars that are set with
@onready
(or in_ready()
) are still unset when the Initial State is first Entered. Only workaround I have found, for nodes use$Node/Path
orget_node()
. For dynamic vars, would need to be hard-coded.I have not found an elegant way around this to "fix", and there may not be. A note or warning may be nice about the load order of when in runs the initial state enter signal.