EntityClient

getCollisionNormalOfLastHitForEntity

GET_COLLISION_NORMAL_OF_LAST_HIT_FOR_ENTITY0xE465D4AB7CA6AE72

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

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

Usage

JavaScript
const { x, y, z } = getCollisionNormalOfLastHitForEntity(entity);
Lua
local coords = getCollisionNormalOfLastHitForEntity(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.

Reference

Namespace
Entity ENTITY
In the game
Vector3 GET_COLLISION_NORMAL_OF_LAST_HIT_FOR_ENTITY(Entity entity)
Hash
0xE465D4AB7CA6AE72

Open in the interactive natives reference