assert that initial state exists
This commit is contained in:
parent
9e72492dc7
commit
41cc35576d
1 changed files with 1 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ class_name StateMachine extends Node
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
assert(state != null, "initial state is null")
|
||||||
for state_node: State in find_children("*", "State"):
|
for state_node: State in find_children("*", "State"):
|
||||||
# fixes duplicate connections (not sure why)
|
# fixes duplicate connections (not sure why)
|
||||||
if not state_node.finished.is_connected(_transition_to_next_state):
|
if not state_node.finished.is_connected(_transition_to_next_state):
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue