GetDeviceGravity

Constructor:

GetDeviceGravity()

Description

Retrieves the gravity vector of the current device.

Return Value

Variable name Class Name Default Description
vector3 Gravity vector returned

Examples

Observe whether the gravity vector is output or not.

wait(1)
local dir = UserInputService:GetDeviceGravity()
print(tostring(dir))