godot-addons/godot-finite-state-machine

State inner class doesn't have a set_state_machine(StateMachine) function

JFerrerBeired opened this issue · 0 comments

The StateMachine.set_state_machine(states: Array) calls State.set_state_machine(self) for each element in the states array, but the inner class State doesn't have such method.

Then if I try the following line from the README.md it obviously doesn't work:

# Convenience method to set state machine on array of states
sm.set_state_machine([idle_state, patrol_state])

I imagine that the expected behaviour is that the State class has a setter function for the state_machine property called set_state_machine that is not implemented.

I've been just reading the source code and not used it already so I'm not sure about that. At first glance I don't know why you should use such thing given that StateMachine.set_state(state_id: String, state: State) actually sets the State.state_machine property to self