ATTACH_ENTITY_TO_ENTITY
Attaches entity1 to entity2 at the given bone, offset and rotation, with options for collision and soft pinning.
Use GET_ENTITY_BONE_INDEX_BY_NAME or GET_PED_BONE_INDEX to find the bone index.
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); // 0x6B9BBD38AB0796DF b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | entity1 | Entity |
| 2 | entity2 | Entity |
| 3 | boneIndex | int |
| 4 | xPos | float |
| 5 | yPos | float |
| 6 | zPos | float |
| 7 | xRot | float |
| 8 | yRot | float |
| 9 | zRot | float |
| 10 | p9 | BOOL |
| 11 | useSoftPinning | BOOL |
| 12 | collision | BOOL |
| 13 | isPed | BOOL |
| 14 | vertexIndex | int |
| 15 | fixedRot | BOOL |
| 16 | p15 | BOOL |
| 17 | p16 | BOOL |
Facts
| Name | ATTACH_ENTITY_TO_ENTITY |
|---|---|
| Hash | 0x6B9BBD38AB0796DF |
| Namespace | |
| Returns | void |
| Game build | 1207 |
Examples
Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.
Citizen.InvokeNative(0x6B9BBD38AB0796DF, -- ATTACH_ENTITY_TO_ENTITY
PlayerPedId(), -- Entity entity1
PlayerPedId(), -- Entity entity2
0, -- int boneIndex
0.0, -- float xPos
0.0, -- float yPos
0.0, -- float zPos
0.0, -- float xRot
0.0, -- float yRot
0.0, -- float zRot
false, -- BOOL p9
false, -- BOOL useSoftPinning
false, -- BOOL collision
false, -- BOOL isPed
0, -- int vertexIndex
false, -- BOOL fixedRot
false, -- BOOL p15
false -- BOOL p16
)// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
Citizen.invokeNative("0x6B9BBD38AB0796DF", // ATTACH_ENTITY_TO_ENTITY
PlayerPedId(), // Entity entity1
PlayerPedId(), // Entity entity2
0, // int boneIndex
0.0, // float xPos
0.0, // float yPos
0.0, // float zPos
0.0, // float xRot
0.0, // float yRot
0.0, // float zRot
false, // BOOL p9
false, // BOOL useSoftPinning
false, // BOOL collision
false, // BOOL isPed
0, // int vertexIndex
false, // BOOL fixedRot
false, // BOOL p15
false // BOOL p16
);Function.Call((Hash)0x6B9BBD38AB0796DF, // ATTACH_ENTITY_TO_ENTITY
API.PlayerPedId(), // Entity entity1
API.PlayerPedId(), // Entity entity2
0, // int boneIndex
0.0f, // float xPos
0.0f, // float yPos
0.0f, // float zPos
0.0f, // float xRot
0.0f, // float yRot
0.0f, // float zRot
false, // BOOL p9
false, // BOOL useSoftPinning
false, // BOOL collision
false, // BOOL isPed
0, // int vertexIndex
false, // BOOL fixedRot
false, // BOOL p15
false // BOOL p16
);Related ENTITY natives
- ATTACH_ENTITY_TO_ENTITY_PHYSICALLY
- _ATTACH_ENTITY_TO_COORDS_PHYSICALLY
- _GET_LAST_ENTITY_TO_DAMAGE_ENTITY
- HAS_ENTITY_CLEAR_LOS_TO_ENTITY
- HAS_ENTITY_CLEAR_LOS_TO_ENTITY_IN_FRONT
- IS_ENTITY_ATTACHED_TO_ENTITY
- APPLY_FORCE_TO_ENTITY
- APPLY_FORCE_TO_ENTITY_CENTER_OF_MASS
- _SET_ENTITY_ROTATION_PARALLEL_TO_LINE
- CLEAR_ENTITY_LAST_DAMAGE_ENTITY
- DOES_ENTITY_BELONG_TO_THIS_SCRIPT
- GET_ENTITY_ATTACHED_TO
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.