What ProximityGroup is used for?

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

There is a ProximityGroup class under Spatial
I guess it could be very useful, but I don’t know how to use it and for what.
Can someone give me the details or sample demo?

From the documentation, my guess is that, when we call its broadcast method it calls that method on all nodes which are inside the proximity radius.

vinod | 2016-08-05 15:54

:bust_in_silhouette: Reply From: leonardmeagher2

So I realize this question is nearly 4 years old, but I was wondering the same thing recently and decided to read the source code.

first you set a group name
then a dispatch mode: proxy will call a function on the ProximityGroup’s parent, signal will just make the ProximityGroup emit a signal

when you call broadcast("some_func_name", args) it will either call your function on the parent node, or emit a signal BUT if there are any other proximity groups within you grid_radius it will also broadcast on them

Basically you can get fast localized function calls on overlapping regions