EntityClient

getEntityForwardVector

GET_ENTITY_FORWARD_VECTOR0x0A794A5A57F8DF91

The 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.

SignatureJavaScript
getEntityForwardVector(entity: Entity): { x: number, y: number, z: number }
SignatureLua
getEntityForwardVector(entity: Entity): Vector3

Usage

JavaScript
const { x, y, z } = getEntityForwardVector(entity);
Lua
local coords = getEntityForwardVector(entity)
-- coords.x, coords.y, coords.z

Parameters

ParameterTypeJavaScriptLua
entityEntitynumberinteger

Returns

Vector3 JavaScript { x: number, y: number, z: number }, Lua Vector3

A 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

Open in the interactive natives reference