Attaching to joints?

Blitz3D Forums/Blitz3D Beginners Area/Attaching to joints?

Lordon(Posted 2004) [#1]
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?


jhocking(Posted 2004) [#2]
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.


Lordon(Posted 2004) [#3]
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?


jhocking(Posted 2004) [#4]
It should be
LH = FindChild(human,"LH")

Note the quotation marks.


Lordon(Posted 2004) [#5]
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)


jhocking(Posted 2004) [#6]
EntityX etc. default to local coordinates. To get global coordinates you need to write:
EntityX(LH,True)


Lordon(Posted 2004) [#7]
sry i haven't responded, havent' had time to play around with it. seems to work now, thanks for yur help =)