getEntityVelocity
GET_ENTITY_VELOCITY0x4805D2B1D8CF94A9The GTA V native GET_ENTITY_VELOCITY of the ENTITY namespace, as LS:MP client scripts call it: the global function getEntityVelocity, in JavaScript and in Lua.
getEntityVelocity(entity: Entity): { x: number, y: number, z: number }getEntityVelocity(entity: Entity): Vector3Usage
JavaScript
const { x, y, z } = getEntityVelocity(entity);Lua
local coords = getEntityVelocity(entity)
-- coords.x, coords.y, coords.zParameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
entity | Entity | number | integer |
Returns
Vector3 JavaScript { x: number, y: number, z: number }, Lua Vector3A 3D vector. JavaScript gets a plain { x, y, z } object; Lua gets a real Vector3, with .x .y .z and arithmetic. As an argument, one vector fills three consecutive coordinates.
Reference
- Namespace
- Entity ENTITY
- In the game
Vector3 GET_ENTITY_VELOCITY(Entity entity)- Hash
0x4805D2B1D8CF94A9