onready var state: State = get_node(initial_state) setget set_state
onready var _state_name: = state.name
The error happens on the second line.
Thank you for the quick reply.
Tried that now I get "Attempt to call function 'enter' in base 'null instance' on a null instance."
func _ready() -> void:
Error happens on the third line.
Ah, it seems like you're not getting any state node. So the error is most likely either that you didn't set the initial state in your state machine, or you didn't set a correct path.
Ensure that initial_state is set in the inspector and it references an existing node of type State.
That was it, thanks!