getEntityForwardVector
GET_ENTITY_FORWARD_VECTOR0x0A794A5A57F8DF91The GTA V native GET_ENTITY_FORWARD_VECTOR of the ENTITY namespace, as LS:MP client scripts call it: the global function getEntityForwardVector, in JavaScript and in Lua.
getEntityForwardVector(entity: Entity): { x: number, y: number, z: number }getEntityForwardVector(entity: Entity): Vector3Usage
JavaScript
const { x, y, z } = getEntityForwardVector(entity);Lua
local coords = getEntityForwardVector(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.
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Gets the entity's forward vector.
Reference
- Namespace
- Entity ENTITY
- In the game
Vector3 GET_ENTITY_FORWARD_VECTOR(Entity entity)- Hash
0x0A794A5A57F8DF91