Tutorial #5b: Attaching Weapons

This section shows you how to attach weapons, or any other objects to your bots, and animate them. We placed this under tutorial 5b, with Mechanim Animations, because usually your weapons animate along with your bot.

Basically, it’s very simple: You attach a gun to your bot in the same way you attach any other object in Unity.  Simply drag the raw 3D model as a child into the bot’s rig.

So in your editor hierarchy, assume you have a human bot.  When you open up his rig, it will probably display “Head” “Right Shoulder” “Right Elbow”  “Right Hand” “Torso” etc….  You simply drag your weapon model as a child of the “Right Hand” object.  Be sure to remove any colliders and your weapon model is not marked as STATIC.  Your weapon model will then animate along with the bot.