I'm trying to debug an issue with my game, where the function that should be connected to a signal is not being called. I have a created minimal repro of the situation by:
Create a fresh Godot 4 project
Create a
Thing
scene withStaticBody2D
node (with sprite and square collision shape) and aThing.gd
script:extends StaticBody2D func _on_input_event(viewport, event, shape_idx): if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT: modulate = Color(1,1,0,1) if event.is_pressed() else Color(1,1,1,1)
The
_on_input_event
function is connected to theinput_event
signal of theStaticBody2D
.Creating a
Root
Node2D
node with aRoot.gd
script:extends Node2D var thing_scene = preload("res://Thing.tscn") func _ready(): var other_thing = thing_scene.instantiate() other_thing.position = Vector2(200, 200) add_child(other_thing)
Set a break point at that last line of code
Run the
Root
node in debug modeWhen the breakpoint hits, click "Locals" => "other_thing"'s Object ID to open the Inspector
At this point I can see the properties of the Node, like so:
My problem is that I see nothing if I then click on the "Node" tab next to "Inspector", it will just say:
Select a single node to edit its signals and groups
Here's a screenshot of that:
What I was hoping to see is the same thing I see when not running in Debug mode and selecting the to-be-instantiated scene's StaticBody2D
node:
In my sample / repro above the signal is working because I can observe the function's effects. In my actual game the signal is not working, which is why I'm looking for a way to debug that situation. I want to know if the signal is connected at all, or if something else is causing my issues.
Bottom line: How can I check connected signals for a component created with instantiate()
while debugging?