How to disconnect a signal from a node?

Godot Version

4

Question

Godot Docs doesn’t have enough information on how to do this.
image

I have an array, and I want to update the arguments of my function connected to my buttons every time I delete an element in that array.

image

I want to delete this element and reflect that changes to my array properly.

	if node.signal_name.is_connected(_on_delete_wall_pressed):
		node.signal_name.disconnect(_on_delete_wall_pressed)

In your case, node is walls[i].get_child(1) and signal_name is pressed.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.