What's the general approach to support variety of weapons in player's hands?

I currently have a 3d model that has empty hands. Should I have separate weapon models that I will just create and render into players hands in the game, or should I implement them in the actual model instead?

If they are not in the model, then how do I make the weapon appear in the right position, especially when considering that I want the player to have a walking animation and perhaps running too.

  • 1
    \$\begingroup\$ If you have a 3D model with animations you probably have a bone animation system. If so, use the "hand" bone position and orientation to render the weapon :) \$\endgroup\$
    – Grimshaw
    Feb 5, 2012 at 21:14
  • \$\begingroup\$ @DevilWithin can you point me to some articles that discuss these matters? \$\endgroup\$
    – rFactor
    Feb 5, 2012 at 21:34
  • \$\begingroup\$ possible duplicate of How do you add equipment to a 3D character model using XNA/Blender? \$\endgroup\$
    – bummzack
    Feb 5, 2012 at 22:11

2 Answers 2


In general, the way this works is very simple. Your characters have a list of bones, which are animated by the animation system. You renderer takes these animated bones and uses them to draw the mesh via skinning or some similar technique.

So you simply add an extra bone to the animation system. This bone is not weighted to any vertices; it's there solely to position objects your character carries. Typically, this bone is either a child of the animation root or a child of the hand.

When you execute your animation system and get the bone-to-object space matrices for each bone, you get one for the "extra" bone as well. Just use that as the transform for the object you want the character to "carry". If the animators and modelers did their jobs (animation must position and orient the bone correctly, modelers must build the mesh to fit the hands and center the object on the place where the character will hold it), then the object will appear in the character's hand.

  • \$\begingroup\$ I was just wondering how good this technique will work, if the objects that are carried can vary substantially in size. Etc, a broadsword vs a longsword. The difference in weight might give some unconvincing animations.[?] \$\endgroup\$
    – Cardin
    Feb 6, 2012 at 1:02
  • 1
    \$\begingroup\$ @Cardin: And? If you decide you need separate "longsword idle" and "broadsword idle" animations, that's up to you. It won't affect how you put the weapons in the hand of the characters. You asked how to attach weapons to characters, and that's how you do it. How you make it look convincing is up to you ;) \$\endgroup\$ Feb 6, 2012 at 1:07

You want to get the position and general orientation of the hand, then put the weapon in it. This saves you from having to have duplicate character models for each weapon.

You then might want to consider setting the other hand after this has happened to be positioned on a forward grip, or on the barrel of a shotgun, or just by your side for a pistol etc.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .