add useful debug info and assertion
This commit is contained in:
parent
77a6bea4d6
commit
43500b3ca5
1 changed files with 6 additions and 0 deletions
|
|
@ -38,6 +38,12 @@ func _get_initial_state() -> State:
|
|||
|
||||
## Transitions the active state out after receiving a finished signal.
|
||||
func _transition_to_next_state(target_state_path: String, data: Dictionary = {}) -> void:
|
||||
print("+++ TRANSITION CALLED: ", target_state_path)
|
||||
print("+++ Has node? ", has_node(target_state_path))
|
||||
print("+++ All children: ", get_children().map(func(c: Node) -> StringName: return c.name))
|
||||
|
||||
assert(has_node(target_state_path), owner.name + ": Trying to transition to state " + target_state_path + " but it does not exist.")
|
||||
|
||||
if not has_node(target_state_path):
|
||||
printerr(owner.name + ": Trying to transition to state " + target_state_path + " but it does not exist.")
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue