self:get_gravity

Client

Retrieves the current combined gravity vector affecting the static 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 static body
local entity = physics.static.create()
local gravity = entity:get_gravity()

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

On this page