Changeable weapons (linking objects to animations?)

Ok so i think there maybe other information on this but i was having trouble finding it…



So say you have a playable animated model (in Blender) that walks,runs,jumps whatever… Now i want to be able to have different attacks, say sword attacks with a sword… Bow attacks, spear attacks etc…



How could I change the weapon in the models hand? I could make seperate models of characters holding each type of weapon but i really want to avoid duplicating all the work.



I was hoping you animate all the different attack styles with one human model… attach a node to the end of the characters arm, or something, and attach/dettach different weapons/shields to the arms of the player…



I guess my question is, will the animations move this attached node so that the attached weapon will follow with the animation?



I was wondering if this is the correct approach, or if there is a better way, or if someone who has done this has any pointers…

As far as i’m informed you could attach the models to the “hands” ( means the nodes representing the hands ). They would automaticly transform with the hands since they are children of the hands…



But i would wait for normens answer really, since he is the technical-guru here. And the guru of laughter… And the guru of… mhm. Lets say he is the omni-guru. :slight_smile:

1 Like

I was looking for the same thing and I ran across the post below.



http://hub.jmonkeyengine.org/groups/graphics/forum/topic/adding-weapons-and-armour/



It helped me alot.

1 Like

In the current builds you will need to use

[java]skeletonControl.getAttachmentsNode(boneName);[/java]



instead of the suggested

[java]bone.getAttachmentsNode();[/java]



because that method is no longer visible.

1 Like

just be careful to note that the 'tail" of the bone is the point of reference for attachments, the devs can correct me, if I am wrong, but I had to offset a weapon that was supposed to match the position of a “weapon bone” but didn’t quite do what I was expecting