R3d.World:setGravity

From GiderosMobile
Revision as of 03:48, 18 December 2025 by MoKaLux (talk | contribs) (Created page with "'''Available since:''' Gideros 2019.10<br/> '''Class:''' R3d.World<br/> === Description === Sets the x, y and z gravity of the world. <syntaxhighlight lang="lua"> r3d.Wor...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2019.10
Class: R3d.World

Description

Sets the x, y and z gravity of the world.

r3d.World:setGravity(gx,gy,gz)

Parameters

gx: (number) the world gravity in Newtons on the x axis
gy: (number) the world gravity in Newtons on the y axis
gz: (number) the world gravity in Newtons on the z axis

Example

local world = r3d.World.new(0, -9.8, 0) -- gravity x, y, z, params
world:setGravity(0, 0, 0)
print(world:getGravity())