How to rig guns in Blender?

Before we begin, I’d like to bring attention to something very important. If you’re going to use your weapon in Unreal Engine, I highly suggest reading this post Blender to Unreal Engine 5: Complete animation workflow first and making sure applying the settings that I provided there to avoid any conflict between Blender and Unreal Engine 5. I do not use Unity, therefore I am not really sure how well Blender and Unity communicate, but if you don’t follow the mentioned steps there, your animation will cause problems when you import it to Unreal.

Note: If you are tired of watching video tutorials and would like to see more text-based tutorials like this one from me, you can support me on Patreon so I can dedicate more time to creating them.

Let’s rig our gun

The very first step to take is, joining the different parts of the mesh all together. To do so, select every mesh that you want to join and hit CTRL + J. (Let me underline this part again: Make sure of after this action, you follow the steps I provided a link to above). At this stage, I suggest bringing a character if you’re going to use it in a FPS or TPS game, and adjust the rotation and placement/scale of the gun first according to the arms of the character, and applying all transforms. (Ctrl + A). Now, in Edit mode, select each parts of the gun that needs to be animated. I’ll start with the trigger.

A note, if you’re experiencing shading issues: After you join all the meshes together if you’re getting shading issues, go to the “Object Properties” tab, and underneath the “Geometry Data” section, press “Clear Custom Split Normals”. This issue occurs usually when the meshes you joined together are using different type of smoothing options. (Smooth/auto smooth or flat.)

Lazy Loaded Image

Selecting the trigger

Lazy Loaded Image

Assigning the selected vertices to a vertex group.

I’ll hover over my trigger and press “L” to select all of it since it’s a separate mesh. After that, go to the “Object Data Properties” panel and create a new vertex group for the trigger and assign the selected vertices to this group. Now let’s think of the other moving parts of our weapon. We will definitely have a reloading animation, so we should do the same thing for the magazine, and the other parts of the gun as a whole that don’t need to be animated.

Lazy Loaded Image

Magazine, trigger and the rest of the gun have their own separate vertex groups created and assigned respectfully

I am done with the vertex grouping. (I had already rigged this weapon earlier for a project, in order to keep things short, I’ll just keep my rig simple.)

Next step is switching to an object mode, and adding a single bone by following the “Shift A > Armature > Single Bone” path.

Lazy Loaded Image

Adding a bone and duplicating it and edit mode.

In edit mode, you can duplicate the bones by pressing “Shift + D”. Make sure you put an individual bone for the each section that you want to animate. In my case these sections are trigger, magazine and the rest of the gun.

Lazy Loaded Image

I’m done with adding the bones to my weapon

Now, this next part is very important. Naming convention here matters. As you can see on the top right side, I started naming my bones [Magazine — Bone.001 — Bone.002]. What we need to pay attention to here is, making sure the bones and the vertex group we assigned earlier share the same names. So the bone I put in the magazine area has the name of “Magazine” because that’s how I named the vertex group of the magazine area before. I’ll also change the title of “Armature” to “Weapon_Rig” or something in that regard since Unreal doesn’t like the term “‘Armature” or “Root” for some reason and creates issues with it during importation in some cases.

Lazy Loaded Image

Completed naming all of my bones and made sure they’re sharing the same news with their corresponding vertex groups.

The next step is selecting the weapon mesh first, then the armature second, pressing “Ctrl + P” and selecting the “with empty groups” option. Now if you choose your armature and go to the pose mode, you should be able to move any faces attached to the bone freely.

Lazy Loaded Image

Your advertisement can be placed here for $200 permanently. Suggested resolutions: 1800x663 or 1400x1400. Contact us.

Lazy Loaded Image

And as we can see here, the hierarchy has been imported to the Unreal without any issues and everything works fine.

Lazy Loaded Image

And as we can see here, the hierarchy has been imported to the Unreal without any issues and everything works fine.

I hope you found this tutorial helpful.