Native referenceFiveM

ATTACH_CAM_TO_PED_BONE

0x61A3DBA14AB7F411 CAM
FUNCTION SIGNATURE
void ATTACH_CAM_TO_PED_BONE(Cam cam, Ped ped, int boneIndex, float xOffset, float yOffset, float zOffset, BOOL isRelative);
Property Value
Native Name ATTACH_CAM_TO_PED_BONE
Hash 0x61A3DBA14AB7F411
Return Type void
Parameters cam (Cam), ped (Ped), boneIndex (int), xOffset (float), yOffset (float), zOffset (float), isRelative (BOOL)

Description: This native works with peds only.

Parameters

  • cam (Cam) — The camera handle.
  • ped (Ped) — The ped handle.
  • 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. cam will be attached to the center of ped if bone index given doesn't correspond to bone indexes for that entity type.
  • xOffset (float) — X-axis offset
  • yOffset (float) — Y-axis offset
  • zOffset (float) — Z-axis offset
  • isRelative (BOOL) — Whether or not the camera will be relative to the bone

Examples

local ped = PlayerPedId()
local cam = CreateCam("DEFAULT_SCRIPTED_CAMERA", true)

AttachCamToPedBone(cam,ped,4089, 0.0, 0.0, 0.0, true) -- attach it to a finger on the left hand

SetCamActive(cam, true)
RenderScriptCams(true, false, 0, true, true)

Back to CAM