self:get_linear_velocity

Client

Retrieves the linear velocity of the rigid 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 rigid body
local entity = physics.rigid.create()
local velocity = entity:get_linear_velocity()

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

On this page