Attaching to joints?

Blitz3D Forums/Blitz3D Beginners Area/Attaching to joints?

I want to make the character have a variety of weapons, the equipped one in his hand. is there a way to attach the weapon to his hand in-game? Im thinking there's a way to attach an entity to a "weapon-joint" which is made in the animator?

First you assign a handle for the joint; use FindChild with the name of the joint you set in your animation tool. Then use EntityParent to attach the gun.

ok, i name the hand i want the gun in "LH", then i assign a handle to the joint with:

LH = FindChild(human,LH)

the i parent it with:

EntityParent weapon,LH

so i run the animation and the weapon doesn't move... can u tell what im doing wrong?

It should be
LH = FindChild(human,"LH")

Note the quotation marks.

cool, it works now, but how do i move the weapon to that hand? i used:

PositionEntity weapon,EntityX(LH),EntityY(LH),EntityZ(LH)

but it didn't move the weapon to the hand, it moved it to another spot, did i do something wrong in the animator?(CFX)

EntityX etc. default to local coordinates. To get global coordinates you need to write:
EntityX(LH,True)

sry i haven't responded, havent' had time to play around with it. seems to work now, thanks for yur help =)