How to connect a signal to an instanced scene (godot 4)

Godot Version



I have a problem with connecting signal from an instanced scene. I am making a visual novel game and I tried implementing choices, but I can’t get the choice button to signal when the button was pressed. please help. It was so much easier in godot 3 :<

Main script

var CB = ChoiceButton.instantiate()
CB.connect("choice_made", _on_choice_made.bind(CB))
print(is_connected("choice_made", Callable(self, "_on_choice_made")))

and I do have a function _on_choice_made(CB) that it should signal to.
the script on the choice button scene is

signal choice_made(Choice)

func _on_choice_button_pressed():
	emit_signal("choice_made", ButtonLabel.text)

Everything else works. No errors show up. I tried to connect it many ways and looked through the docs but the connect function just never works. Godot 3 was so much simpler

Why are you binding here?
That is not necessary and probably what is causing the issue.
CB.connect("choice_made", _on_choice_made)

After half a year of being mad at godot I came back to this problem, and it turns out that no, binding wasn’t the thing that caused the problem, but I just connected the signal improperly. It’s a shame that godot docs don’t explain how to do it properly and the way it’s shown there didn’t work.


So you connect the signal that way:


I really don’t understand why they made it wrong in the docs:

connect(signal: StringName, callable: Callable, flags: int = 0)

you’re looking at the Object page, where you call the connect function on the object and pass in the string representing the signal

your way is documented on the signal page Signal — Godot Engine (stable) documentation in English

idk what it looked like when you read the page but now it shows both ways of doing it on the Object page