self:get_linear_velocity

Client

Retrieves the linear velocity of the vehicle body


Syntax

local velocity = self:get_linear_velocity()

Parameters

No parameters are accepted by this function

Returns

TypeNameDescription
vector3velocityCurrent linear velocity as {x, y, z}

Examples

Get the linear velocity of a vehicle body
local entity = physics.vehicle.create()
local velocity = entity:get_linear_velocity()

core.engine.print("info", "Vehicle body velocity:", util.table.unpack(velocity))

On this page