World:getGravity

Edit

Returns the World's gravity. Gravity is a constant acceleration applied to all colliders. The default is (0, -9.81, 0) meters per second squared, causing colliders to fall downward.

Use Collider:setGravityScale to change gravity strength for a single collider.

gx, gy, gz = World:getGravity()

Arguments

None

Returns

NameTypeDescription
gxnumber The x component of the gravity force, in meters per second squared.
gynumber The y component of the gravity force, in meters per second squared.
gznumber The z component of the gravity force, in meters per second squared.

Notes

Kinematic colliders ignore gravity, since they are not moved by forces. Colliders with higher mass do not fall faster.

See also