Topic was automatically imported from the old Question2Answer platform.
Asked By
Hammo
How does one connect signals from other children (horizontally in the scene tree) without using the interface? I know of the connect function, but I’ve only used it from a parent.
and suppose you want code in Node/Node’s script to do the job of connecting the Node/Button’s pressed signal to the function button_got_pressed in Node/OtherNode’s script.
Then you would write something like this in Node/Node:
func _ready():
var button = get_parent().get_node("Button")
var other_node = get_parent().get_node("OtherNode")
button.connect("pressed", other_node, "button_got_pressed")
and the script on Node/OtherNode would have something like this