self:set_velocity

Client

Sets the velocity of the character body, used as the input for the next `move_and_slide` call


Syntax

local status = self:set_velocity(
    velocity
)

Parameters

TypeNameDescription
vector3velocityVelocity to apply as {x, y, z}

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Set the velocity of a character body
local entity = physics.character.create()

entity:set_velocity({0, 0, -5})

On this page