I found a few people have asking this, but I haven't found a good answer.

So my custom tool nodes can be dragged over each other in the editor to "connect" them. Now, when I delete one, I want the other nodes to forget it.

Some things I've tried so far:

  • NOTIFICATION_PREDELETE:
    Not called. Nodes aren't actually freed when deleted in editor. https://github.com/godotengine/godot/issues/84366

  • tree_exited signal:
    Not enough as is. Covers node deletion, but also many other cases, like changing scene tabs. If I there's some additional "deleted in the editor" status that I can check, this would work.

Any ideas?

  • xyz replied to this.
  • Bezier How about this. When node exits the tree, look for all existing connections, break those connection and store the connection info in the node itself. When node enters the tree, look if it has any stored connections and reconnect them if possible.

    Bezier How about this. When node exits the tree, look for all existing connections, break those connection and store the connection info in the node itself. When node enters the tree, look if it has any stored connections and reconnect them if possible.

      xyz Thanks. That solution isn't great, but it would work. I'll keep it in mind.

      • xyz replied to this.

        Bezier It's actually not bad. Relatively simple to implement and it properly handles undo. Even if there was an explicit node deletion signal, you'd still have to implement something like that if you want to play along with the undo/redo system.