getVehicleGravity | Multi Theft Auto: Wiki Skip to content

getVehicleGravity

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


Retrieves the current gravity vector of a vehicle. This is the direction in which the vehicle falls, also the cameras of any passengers will be rotated to match it.

Syntax

getVehicleGravity ( )

Code Examples

client

This command will get gravity of your vehicle and output to chat using the /grav command

addCommandHandler("grav",function()
local vehicle = getPedOccupiedVehicle(localPlayer)
if (vehicle) then
local x,y,z = getVehicleGravity(vehicle)
outputChatBox("Your vehicle's gravity is: "..x.." "..y.." "..z,0,255,0)
end
end)

See Also

Vehicle Functions