self:apply_impulse

Client

Applies an instantaneous impulse to the rigid body at a specific position, inducing torque


Syntax

local status = self:apply_impulse(
    impulse,
    position = {0, 0, 0}
)

Parameters

TypeNameDescription
vector3impulseImpulse vector to apply as {x, y, z}
vector3positionWorld-space position offset to apply the impulse at

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Apply an off-center impulse
local entity = physics.rigid.create()

entity:apply_impulse({0, 5, 0}, {1, 0, 0})

On this page