self:apply_force
Client
Applies a continuous force to the rigid body at a specific position, inducing torque, for the current physics step
Syntax
local status = self:apply_force(
force,
position = {0, 0, 0}
)Parameters
| Type | Name | Description |
|---|---|---|
vector3 | force | Force vector to apply as {x, y, z} |
vector3 | position | World-space position offset to apply the force at |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = physics.rigid.create()
entity:apply_force({0, 20, 0}, {1, 0, 0})