How to disconnect GraphNodes?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Adham
:warning: Old Version Published before Godot 3 was released.

So I have a couple of GraphNodes as children of a GraphEdit node.

I allowed them to connect by using the connection_request() signal in GraphEdit, this signal is emitted when the user attempts to graphically connect two nodes using the mouse. It works as intended.

However, how do I allow the user to disconnect two slots after a connection has been made? It appears there is adisconnection_request() signal, but I don’t know what action emits this signal, so I’m unable to disconnect any nodes!

Any ideas on how disconnections are implemented?

:bust_in_silhouette: Reply From: eska

Call set_right_disconnects( true ) on the GraphEdit, then drag the connection away from the input slot.

You can also do this from the inspector!

Snail0259 | 2021-07-10 22:30

I don’t understand why this option is there. It just stops the disconnect signal from being sent? So what’s the point?

pangolinmontanari | 2022-09-17 15:44