How would one 'broadcast' a message to all nodes within a certain area?

I want to be able to broadcast a message of sorts to all nodes within a area when a condition is met. I will be using this for damage as I cannot directly interact with specific nodes (I want to be able to maintain a systematic game where all elements react to all elements). I’m sure signals would be the way to do this but I’m not sure how I would have one script detect collisions, in say an area 2d, and then broadcast a message or trigger to all objects that were colliding. I remember doing essentially this in unity but I’m not sure how the Godot equivalent would work. Thanks in advance!

Rather than broadcasting, why not keep a list of current damage sources? Each node can scan the list during their update and see if they’re close enough to take damage. This also lets you do things like iframes trivially; an invulnerable node can ignore the damage source scan.

It also lets you do longer duration damage fields: Say you have an explosion that sticks around for a few frames. With a broadcast system you’d have to re-broadcast it every update. With a list, it just stays on the list. You can even potentially modify it over time, so (say) the explosion radius increases but the damage decreases over half a second.

Doing this also plays nicely with subdividing the world to reduce computational load; if the world is split into a grid, you can keep a list of damage sources per grid cell, and each node can check the list for each cell that might be close enough for something to damage them.

If the damage sources are just flat damage (that is, you take 100% damage if you’re anywhere in the radius) you can simplify the math by using “within distance squared” tests. That gets rid of a bunch of square root calculations, which aren’t particularly fast.