self:apply_impulse
Client
Applies an instantaneous impulse to the vehicle body at a specific position, inducing torque
Syntax
local status = self:apply_impulse(
impulse,
position = {0, 0, 0}
)Parameters
| Type | Name | Description |
|---|---|---|
vector3 | impulse | Impulse vector to apply as {x, y, z} |
vector3 | position | World-space position offset to apply the impulse at |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = physics.vehicle.create()
entity:apply_impulse({0, 5, 0}, {1, 0, 0})