Native referenceRedM

ATTACH_ENTITY_TO_ENTITY

0x6B9BBD38AB0796DF ENTITY
FUNCTION 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 rotationOrder, BOOL syncRot);
Property Value
Native Name ATTACH_ENTITY_TO_ENTITY
Hash 0x6B9BBD38AB0796DF
Return Type void
Build 1207
Parameters entity1 (Entity), entity2 (Entity), boneIndex (int), xPos (float), yPos (float), zPos (float), xRot (float), yRot (float), zRot (float), p9 (BOOL), useSoftPinning (BOOL), collision (BOOL), isPed (BOOL), rotationOrder (int), syncRot (BOOL)

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

Parameters

  • entity1 (Entity) — Entity to attach.
  • entity2 (Entity) — Entity to attach entity1 with.
  • boneIndex (int) — 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 the center of entity2 if bone index given doesn't correspond to bone indexes for that entity type.
  • xPos (float) — X-axis offset from the center of entity2.
  • yPos (float) — Y-axis offset from the center of entity2.
  • zPos (float) — Z-axis offset from the center of entity2.
  • xRot (float) — X-axis rotation.
  • yRot (float) — Y-axis rotation.
  • zRot (float) — Z-axis rotation.
  • p9 (BOOL) — Unknown. Does not seem to have any effect.
  • useSoftPinning (BOOL) — If set to false attached entity will not detach when fixed.
  • collision (BOOL) — Controls collision between the two entities (FALSE disables collision).
  • isPed (BOOL) — Pitch doesnt work when false and roll will only work on negative numbers (only peds)
  • rotationOrder (int) — The order in which the rotation is applied. See GET_ENTITY_ROTATION
  • syncRot (BOOL) — If false it ignores entity rotation.

Usage

Lua (Direct):

AttachEntityToEntity(entity1, entity2, boneIndex, xPos, yPos, zPos, xRot, yRot, zRot, p9, useSoftPinning, collision, isPed, rotationOrder, syncRot)

Lua (Hash):

Citizen.InvokeNative(0x6B9BBD38AB0796DF, entity1, entity2, boneIndex, xPos, yPos, zPos, xRot, yRot, zRot, p9, useSoftPinning, collision, isPed, rotationOrder, syncRot)
Back to ENTITY