attachCamToVehicleBone
ATTACH_CAM_TO_VEHICLE_BONE0x8DB3F12A02CAEF72The GTA V native ATTACH_CAM_TO_VEHICLE_BONE of the CAM namespace, as LS:MP client scripts call it: the global function attachCamToVehicleBone, in JavaScript and in Lua.
attachCamToVehicleBone(
cam: Cam,
vehicle: Vehicle,
boneIndex: number,
relativeRotation: boolean,
rotX: number,
rotY: number,
rotZ: number,
offsetX: number,
offsetY: number,
offsetZ: number,
fixedDirection: boolean
): voidattachCamToVehicleBone(
cam: Cam,
vehicle: Vehicle,
boneIndex: integer,
relativeRotation: boolean,
rotX: number,
rotY: number,
rotZ: number,
offsetX: number,
offsetY: number,
offsetZ: number,
fixedDirection: boolean
)Usage
JavaScript
attachCamToVehicleBone(
cam, vehicle, boneIndex, relativeRotation, rotX, rotY, rotZ, offsetX, offsetY, offsetZ,
fixedDirection
);Lua
attachCamToVehicleBone(
cam, vehicle, boneIndex, relativeRotation, rotX, rotY, rotZ, offsetX, offsetY, offsetZ,
fixedDirection
)Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.
JavaScript · with vectors
attachCamToVehicleBone(cam, vehicle, boneIndex, relativeRotation, rot, offset, fixedDirection);Lua · with vectors
attachCamToVehicleBone(cam, vehicle, boneIndex, relativeRotation, rot, offset, fixedDirection)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
cam | Cam | number | integer |
vehicle | Vehicle | number | integer |
boneIndex | int | number | integer |
relativeRotation | BOOL | boolean | boolean |
rotX | float | number | number |
rotY | float | number | number |
rotZ | float | number | number |
offsetX | float | number | number |
offsetY | float | number | number |
offsetZ | float | number | number |
fixedDirection | BOOL | boolean | boolean |
Returns
Nothing. In JavaScript the call evaluates to undefined.
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
This native works with vehicles only. Bone indexes are usually given by this native getEntityBoneIndexByName.
Reference
- Namespace
- Camera CAM
- In the game
void ATTACH_CAM_TO_VEHICLE_BONE(Cam cam, Vehicle vehicle, int boneIndex, BOOL relativeRotation, float rotX, float rotY, float rotZ, float offsetX, float offsetY, float offsetZ, BOOL fixedDirection)- Hash
0x8DB3F12A02CAEF72- Introduced
- Game build 1290 legacy numbering
- Formerly
_ATTACH_CAM_TO_VEHICLE_BONE