Weapons for 3D character

Hey, I’m getting ready to add weapons (guns) to my character and am wondering what the best way to go about this is. I’ve done searches and looked at examples trying to find out how best to set this up.

It’s not for an FPS, so the animations are important. I’m using Maya, and not the Unity animation/rigging.

So the easiest way I can think of is to model a weapon into my character model, and then switch out the material (from invisible to texture) when the weapon is selected. I will only have a few weapons in the game so this might work. Still this seams like a really stupid way to do it.

I have tried to parent objects to my character in Unity but can’t get them to animate with the character. Is this because I’m using an external application to create my animations?

What would be the ideal workflow for adding weapons to a character in Unity? Thanks!

Hello,

Yeah, making invisible textures for weapons is definitely not the way to do it. Make the weapons as individual models and then parent the model to the bone you want the sword to follow. When I make animations like this in Blender, I add a special hold bone just in front of the palm, where I want the handle of the sword to be. Then I import the sword into the project in Blender, attach the sword to the bone, and make my animations. Then, when I export to Unity, I only export the character, not the weapon. Then, when I attach the weapon to the bone in Unity, the animations behave just like they do in Blender. The same basic idea should work in Maya.

Now, depending on the different weapons you have depends on how many animations you need to make. For example, if you have multiple swords, try to make it so that the same attack animations will work for each sword. If you have different types of weapons (i.e. axes, maces) then you probably (but maybe not) will want different animations for each weapon type. However, you may not have to make different idle animations for each weapon type, since you can basically hold a sword, ax, or mace the same way.

Now to switch between weapons, I’m a little at a loss there. I have never had to do that, but I’m sure someone else can help you. However, I know there is an easy way to do it. It may be just instantiating the weapon at that spot every time you switch weapons, or it could be you have all the weapons attached to the bone, but you have them disabled until you need them. I don’t know.

Good luck with your game! (and be sure to vote up if it helps)

as far as i know if you don’t have a attach bone from Blender or Maya, you can also attach GameObject"mount"… to you character in unity this way you can also control the attachment, and it should follow your animation. - although i think that you need to attach it in Blender/Maya also to make proper animations…