Replacing Weapons

In this chapter we will cover how to replace existing weapons.

Replacing weapon models from the FPS Animation Pack consists of 2 parts:

  1. Adjusting custom weapon's bones and rigging

  2. Importing the new weapon to the project.

Weapon rigging

First, we need to import our weapons into a fresh Blender project:

The bottom model is what we want to replace

If your model already contains a skeleton, make sure to remove it:

Select the weapon's armature and delete it.

We will use a skeleton from the model we want to replace. This is needed to ensure that both weapons have the same hierarchy so animations can be played without any issues.

Next, we need to create vertex groups for our custom weapon. To do this, right-click on the model and press Tab to activate the "Edit" mode. Select the "Object Data Properties" icon:

Object data properties.

Now you should see the "Vertex Groups" list on the right:

Vertex groups.

These groups define parts of the mesh that will be bound to the skeleton bones. To create a new group, right-click on the "+" icon and set its name to the target bone. It is important to first see what vertex groups are present in the source model and then re-create such groups in your custom model.

Now, we need to assign parts of the weapon to our newly created groups. Here is how to do it step-by-step:

  1. Left-click on the vertex group.

  2. Select the part of the weapon you want to include.

  3. Click the "Assign" button.

Once all parts are assigned, we need to parent our custom model to the target skeleton. To do this, make sure to align weapons:

Perfectly aligned weapons.

Next, select your custom weapon model, then the target skeleton, and press Ctrl + P, select the "Armature Deform" option:

Parenting model to the skeleton.

To export your model as FBX, go to File → Export → FBX. Make sure to use these settings:

Export settings.

Importing to Unity

To import a custom model, right-click → Import Asset.... Once the model is imported, we need to modify the weapon prefab in FPSAnimationPack → Prefabs. Add your new model to the prefab, and copy these components from the old model:

Weapon components.

Last updated