EntityClient

getEntityBonePostion

GET_ENTITY_BONE_POSTION0x46F8696933A63C9B

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

SignatureJavaScript
getEntityBonePostion(
  entity: Entity,
  boneIndex: number
): { x: number, y: number, z: number }
SignatureLua
getEntityBonePostion(entity: Entity, boneIndex: integer): Vector3

Usage

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

Parameters

ParameterTypeJavaScriptLua
entityEntitynumberinteger
boneIndexintnumberinteger

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 world position of the specified bone of the specified entity.

Reference

Namespace
Entity ENTITY
In the game
Vector3 GET_ENTITY_BONE_POSTION(Entity entity, int boneIndex)
Hash
0x46F8696933A63C9B
Introduced
Game build 877 legacy numbering
Formerly
_GET_WORLD_POSITION_OF_ENTITY_BONE_2 _GET_ENTITY_BONE_POSITION_2

Open in the interactive natives reference