From 83395c961db1b0001bfc5a3b016e318e0850e984 Mon Sep 17 00:00:00 2001 From: matehun00 <57267819+matehun00@users.noreply.github.com> Date: Fri, 21 Jul 2023 14:33:30 +0200 Subject: [PATCH] add more information and an example in lua AttachCamToPedBone --- CAM/AttachCamToPedBone.md | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/CAM/AttachCamToPedBone.md b/CAM/AttachCamToPedBone.md index 41aa9f313..547fa5386 100644 --- a/CAM/AttachCamToPedBone.md +++ b/CAM/AttachCamToPedBone.md @@ -8,13 +8,26 @@ ns: CAM void ATTACH_CAM_TO_PED_BONE(Cam cam, Ped ped, int boneIndex, float xOffset, float yOffset, float zOffset, BOOL isRelative); ``` +This native works with peds only. ## Parameters -* **cam**: -* **ped**: -* **boneIndex**: -* **xOffset**: -* **yOffset**: -* **zOffset**: -* **isRelative**: +* **cam**: The camera handle. +* **ped**: The ped handle. +* **boneIndex**: This is different to boneID, use ['GET_PED_BONE_INDEX'](#_0x3F428D08BE5AAE31) 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**: X-axis offset +* **yOffset**: Y-axis offset +* **zOffset**: Z-axis offset +* **isRelative**: Whether or not the camera will be relative to the bone +## Examples + +```lua +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) + +```