How to get gravity vector for Physics2DServer?

: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.

What I want is to get current gravity direction? Is there something like Physics2DServer.get_gravity_vector() .
I tried Physics2DServer.space_get_param(get_world_2d().get_space(), Physics2DServer.AREA_PARAM_GRAVITY_VECTOR) but gives a float value 1.5 not gravity direction vector.

:bust_in_silhouette: Reply From: eons

AREA_* parameters are for area_* methods, you are doing SPACE_PARAM_CONTACT_MAX_SEPARATION (value 1) with that parameter.

What you want is:

Physics2DServer.area_get_param(
    get_world_2d().get_space(),
    Physics2DServer.AREA_PARAM_GRAVITY_VECTOR)