integrate_forces vs Physics2DServer.area_set_param ( area, param, value )

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

Is the only difference between using integrate_forces and Physics2DServer.area_set_param ( area, param, value ) is that former is for individual nodes while the latter is for whole area or space in which nodes are present? Also which is more efficient(In terms of workflow and better to maintain).

:bust_in_silhouette: Reply From: avencherus

There is some small overlap in results that you can achieve, but overall they serve different purposes, so you can’t compare them in such a black and white manner.

Bodies and Areas are two different things. _integrate_forces() is a method to override the default integration of a RigidBody, and the area_set_param() is to change a property in an Area.

Areas can alter a few physics effects, so if the effect is just to dampen or alter gravity in a specific space. It would probably be better to do that with an Area, than individually overriding the integration of any RigidBody that enters a certain point.

Though, if you’re looking to do things specifically to only individual RigidBodies, or get detailed information about it’s collisions, it’s space state provides much more than the physics modifications that can be done by an Area.

http://docs.godotengine.org/en/stable/classes/class_physicsdirectbodystate.html#class-physicsdirectbodystate