self:set_axis_lock

Client

Locks or unlocks a specific movement axis on the character body


Syntax

local status = self:set_axis_lock(
    axis,
    lock
)

Parameters

TypeNameDescription
intaxisAxis enum value — refer to physics.character.axis
boollocktrue to lock the axis, false to unlock it

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Lock an axis on a character body
local entity = physics.character.create()

entity:set_axis_lock(physics.character.axis.LINEAR_X, true)

On this page