| 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.camwill be attached to the center ofpedif bone index given doesn't correspond to bone indexes for that entity type.xOffset(float) — X-axis offsetyOffset(float) — Y-axis offsetzOffset(float) — Z-axis offsetisRelative(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)