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.

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.)

Selecting the trigger
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 definetely 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.

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.

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.

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.

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *