What is the better way to set up a character with a weapon?

I’m asking this to the more experienced.
Let’s say we have a third person game and our player character is a warrior with a sword. The warrior can draw his sword when troubles are coming or walk with his sword in the scabbard.
How would you handle this? In particular my doubts are:

  • Should the weapon be a separate game object or should it be part of the
    character game object?

  • In case the weapon is a separete game object should it be parented to
    a character’s bone or should it have its own animations corresponding to
    the character’s animations?

  • Since the warrior can have the weapon in his hands or not, should I
    create a walk animation with AND without the weapon or should
    I create only one walk animation and then use an animation mask with the
    sword equipped?

  • It is better to use Mecanim for such things or should it all be strictly scripted?

  • EDIT: Now if the weapon is some sort of gun the warrior has a new state: aiming. He can aim in some direction when the mouse is moved. Should I implement this by scripting the chest bone rotation or by scripting a Mecanim blend tree between up, down, left and right aiming animations?

So what is the best and more efficient workflow for this common situation?

heya… I woud do that this way:

  • I would do the weapon separated, because you might want to switch weapons

  • I would do an empty game object, position it correctly and then parent it to the wrist bone. You might even do for both hands, in case you need the character to switch the arms with which he/she is holding the weapon. Make it’s own animations and it’s own blendtree (If any) and activate them from script.

  • Since the weapon will be separate, you can just make one walk and one separate motion for holding the sword (Idle), just for the arm and the other animations, for using the sword (Hitting, etc) and then just mask the arms, to replace the animation when you activate some of the motions.

  • MM… what do you mean Mecanim or strictly scripted? You can’t script the whole animation. Use mecanim for the layers of the animation and then call the separate animations by script…

of course this is how i woud do it :). I’m not saying that it’s the perfect way…

  • List item