GetGravity

Constructor:

GetGravity()

Description

Retrieves the gravity of the current game world.

Return Value

Type Description
Vector3 Gravity of current game world

Examples

Retrieves the gravity of the current game world.

local function MyUpdate()
    local gravity = WorkSpace:GetGravity()
    print("gravity ============"..tostring(gravity))
end
    
local function coroutineUpdate()
    while true do
        coroutine.wait(0.1)
        MyUpdate()
    end
end

coroutine.start(coroutineUpdate)