self:set_axis_lock
Client
Locks or unlocks a specific movement axis on the animatable body
Syntax
local status = self:set_axis_lock(
axis,
lock
)Parameters
| Type | Name | Description |
|---|---|---|
int | axis | Axis enum value — refer to physics.animatable.axis |
bool | lock | true to lock the axis, false to unlock it |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = physics.animatable.create()
entity:set_axis_lock(physics.animatable.axis.LINEAR_X, true)