From 43500b3ca532359a11d91de3010e2f7008a54542 Mon Sep 17 00:00:00 2001 From: yuki Date: Fri, 14 Nov 2025 22:22:50 -0300 Subject: [PATCH] add useful debug info and assertion --- scenes/classes/state_machine.gd | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scenes/classes/state_machine.gd b/scenes/classes/state_machine.gd index 8b9f25d..6286750 100644 --- a/scenes/classes/state_machine.gd +++ b/scenes/classes/state_machine.gd @@ -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