# SetAttachBones

Objects
Display
5.1 OC
bool
int attach_number Number of the attached mesh. The return value of AttachMesh provides such a number.
string parent_bone Bone of the calling object at which to attach the mesh.
string child_bone Bone of the object to be attached.
If a mesh was previously attached to another mesh then this function can be used to change one or both of the bones at which they are attached. To only change a single bone the other parameter can be set to `nil`.
func FxIntCarryBowStart(object target, effect) { effect.mesh = target->AttachMesh(Bow, "pos_hand1", "main"); effect.inhand1 = true; }

func FxIntCarryBowTimer(object target, effect) { if(effect.inhand1) target->SetAttachBones(effect.mesh, "pos_hand2", nil); else target->SetAttachBones(effect.mesh, "pos_hand1", nil); effect.inhand1 = !effect.inhand1; }
Script for an effect: Initially the clonk carries a bow and for each timer call the bow is switched from its left hand to its right hand or vice versa.
AttachMesh
DetachMesh
SetAttachTransform
Clonk-Karl
2010-04