- Documentation
- Shared functions
- setElementBonePositionOffset
Function
setElementBonePositionOffset
Changes the offset of an element attached to a bone, without re-attaching it. The element moves relative to the bone right away.
Syntax
bool setElementBonePositionOffset(element theElement, float x, y, z)Arguments
theElementelement- An element attached with
attachElementToBone. x, y, zfloat- The new offset from the bone.
Returns
true on success, false if the element is not attached to a bone.
Example
setElementBonePositionOffset(box, 0.05, 0.15, 0)
See also
attachElementToBoneAttaches an element (e.g. an object) to a ped's bone, with an offset and rotation. The element moves with the bone, e.g. a hat with the head or a weapon in a hand. Bone numbers are the same as ingetBoneIDs(e.g. 1 pelvis, 8 head, 25 right hand, 35 left hand).getElementBonePositionOffsetReturns the offset of an element attached to a bone.setElementBoneRotationOffsetChanges the rotation of an element attached to a bone, without re-attaching it.