self:get_gravity

Client

Retrieves the current combined gravity vector affecting the animatable body


Syntax

local gravity = self:get_gravity()

Parameters

No parameters are accepted by this function

Returns

TypeNameDescription
vector3gravityCurrent gravity vector as {x, y, z}

Examples

Get the gravity affecting a animatable body
local entity = physics.animatable.create()
local gravity = entity:get_gravity()

core.engine.print("info", "Animatable body gravity:", util.table.unpack(gravity))

On this page