Difference between <area_set_monitor_callback> and <area_set_area_monitor_callback>?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By toblin

I’m trying to optimize using servers, and I find two very similar functions in the PhysicsServer. One is the:
PhysicsServer.area_set_monitor_callback(...)
that you can read about here, and the other is the:
PhysicsServer.area_set_area_monitor_callback(...)
that you can read about here.

As far as I understand, the methods are both used to define the function that should be called when a body interacts with the given area (entering or exiting the area).

My question is: what is the difference between them?

:bust_in_silhouette: Reply From: Zylann

area_set_monitor_callback is for monitoring bodies.
area_set_area_monitor_callback is for monitoring areas.

However the documentation confuses me because it says area_set_monitor_callback monitors both: https://docs.godotengine.org/en/stable/classes/class_physics2dserver.html#class-physics2dserver-method-area-set-monitor-callback
While area_set_area_monitor_callback is not documented at all. Same in 3D.

Awesome! Obvious in retrospect. Thanks dude!

toblin | 2020-04-24 12:44