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
| Type | Name | Description |
|---|---|---|
vector3 | velocity | Velocity to apply as {x, y, z} |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = physics.character.create()
entity:set_velocity({0, 0, -5})