Connecting singals across different deeply nested scenes trees

Godot Version

4.6

Question

What are the correct ways to handle signals that need to reach very distant points on the scene tree?

I have the following scene structure where each ‘View’ handles a different view of different 2D scenes, the thing is that under the camera there’s a zoom component that zooms it’s respective camera but also sends an ‘updated_zoom’ signal, this signal has to be relative to each view, I don’t want the zoom updates of one view to affect the other so a barebones SignalBus singleton is of no use since the signal would connect to both views.

I’ve come up with a couple of solution I think are not too ideal.

  • Add an extra variable to the signal inside the SignalBus to indicate what view it’s supposed to update(not ideal since the information about the view would have to be propagated downward to the component, this make very messy scenes)
  • Connect the signals upwards through all the parent nodes until it reaches the one in charge of calling downward to the target node, in this case ZoomComponent → Camera →View for the signal and doward calls like View → PersonHandler →whateverComponent. (This creates a long chain of signals and calls that’s also very messy to handle)

In essence the questions goes down to what the correct way of connecting very distant components is while maintaining flexibility for different components.

Any feedback is much appreciated :smile: