RedM Natives

ATTACH_ENTITY_TO_ENTITY

Attaches entity1 to bone (boneIndex) of entity2.

Hash0x6B9BBD38AB0796DF
Runtime nameAttachEntityToEntity
NamespaceENTITY
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x6B9BBD38AB0796DF

Signature

void ATTACH_ENTITY_TO_ENTITY(Entity entity1, Entity entity2, int boneIndex, float xPos, float yPos, float zPos, float xRot, float yRot, float zRot, BOOL p9, BOOL useSoftPinning, BOOL collision, BOOL isPed, int vertexIndex, BOOL fixedRot, BOOL p15, BOOL p16);

Parameters

NameTypeDescription
entity1Entity—
entity2Entity—
boneIndexint—
xPosfloat—
yPosfloat—
zPosfloat—
xRotfloat—
yRotfloat—
zRotfloat—
p9BOOL—
useSoftPinningBOOL—
collisionBOOL—
isPedBOOL—
vertexIndexint—
fixedRotBOOL—
p15BOOL—
p16BOOL—

Returns void

Description

Attaches entity1 to bone (boneIndex) of entity2.

boneIndex - this is different to boneID, use GET_PED_BONE_INDEX to get the index from the ID. use the index for attaching to specific bones. entity1 will be attached to entity2's centre if bone index given doesn't correspond to bone indexes for that entity type.
https://github.com/femga/rdr3_discoveries/tree/master/boneNames

useSoftPinning - if set to false attached entity will not detach when fixed
collision - controls collision between the two entities (FALSE disables collision).
isPed - pitch doesn't work when false and roll will only work on negative numbers (only peds)
vertexIndex - position of vertex
fixedRot - if false it ignores entity vector

Usage

Lua
AttachEntityToEntity(entity1, entity2, boneIndex, xPos, yPos, zPos, xRot, yRot, zRot, p9, useSoftPinning, collision, isPed, vertexIndex, fixedRot, p15, p16)

-- always works, by hash
Citizen.InvokeNative(0x6B9BBD38AB0796DF, entity1, entity2, boneIndex, xPos, yPos, zPos, xRot, yRot, zRot, p9, useSoftPinning, collision, isPed, vertexIndex, fixedRot, p15, p16)
JavaScript and C#
JavaScript
AttachEntityToEntity(entity1, entity2, boneIndex, xPos, yPos, zPos, xRot, yRot, zRot, p9, useSoftPinning, collision, isPed, vertexIndex, fixedRot, p15, p16);

// by hash
Citizen.invokeNative('0x6B9BBD38AB0796DF', entity1, entity2, boneIndex, xPos + 0.0000001, yPos + 0.0000001, zPos + 0.0000001, xRot + 0.0000001, yRot + 0.0000001, zRot + 0.0000001, p9, useSoftPinning, collision, isPed, vertexIndex, fixedRot, p15, p16);
C#
Function.Call((Hash)0x6B9BBD38AB0796DF, entity1, entity2, boneIndex, xPos, yPos, zPos, xRot, yRot, zRot, p9, useSoftPinning, collision, isPed, vertexIndex, fixedRot, p15, p16);
  • Float parameters: Lua integers (10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write 10.0 or value + 0.0. The generated JS wrappers add 0.0000001 to non-zero floats for the same reason.

Enums and flags

Sources

alloc8or RDR3 NativeDB

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.