EntityClient

setEntityVelocity

SET_ENTITY_VELOCITY0x1C99BB7B6E96D16F

The GTA V native SET_ENTITY_VELOCITY of the ENTITY namespace, as LS:MP client scripts call it: the global function setEntityVelocity, in JavaScript and in Lua.

SignatureJavaScript
setEntityVelocity(entity: Entity, x: number, y: number, z: number): void
SignatureLua
setEntityVelocity(entity: Entity, x: number, y: number, z: number)

Usage

JavaScript
setEntityVelocity(entity, x, y, z);
Lua
setEntityVelocity(entity, x, y, z)

Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.

JavaScript · with vectors
setEntityVelocity(entity, pos);
Lua · with vectors
setEntityVelocity(entity, pos)

Parameters

ParameterTypeJavaScriptLua
entityEntitynumberinteger
xfloatnumbernumber
yfloatnumbernumber
zfloatnumbernumber

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Note that the third parameter(denoted as z) is "up and down" with positive numbers encouraging upwards movement.

Reference

Namespace
Entity ENTITY
In the game
void SET_ENTITY_VELOCITY(Entity entity, float x, float y, float z)
Hash
0x1C99BB7B6E96D16F

Open in the interactive natives reference