> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinemation.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Replacing Weapons

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

<Tip>
  **Note**: Blender software is required for this tutorial.
</Tip>

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:

<Frame caption={"The bottom model is what we want to replace"}>
  <img src="https://mintcdn.com/kinemation/PlmzVQHJ3J_C1x92/images/fps-animation-pack/unity/5bb7f5c2ea8c6ae82168.png?fit=max&auto=format&n=PlmzVQHJ3J_C1x92&q=85&s=24777b802d84e2a911ad8e844e935279" alt="" width={563} data-path="images/fps-animation-pack/unity/5bb7f5c2ea8c6ae82168.png" />
</Frame>

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

<Frame caption={"Select the weapon\u0027s armature and delete it."}>
  <img src="https://mintcdn.com/kinemation/PlmzVQHJ3J_C1x92/images/fps-animation-pack/unity/5f3b908c45fb9b5adbff.png?fit=max&auto=format&n=PlmzVQHJ3J_C1x92&q=85&s=43be7de9cb8d6b0e0f92360bc5f51f7c" alt="" width={250} data-path="images/fps-animation-pack/unity/5f3b908c45fb9b5adbff.png" />
</Frame>

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:

<Frame caption={"Object data properties."}>
  <img src="https://mintcdn.com/kinemation/PlmzVQHJ3J_C1x92/images/fps-animation-pack/unity/3bb1dfb2d7c55d4a00e4.png?fit=max&auto=format&n=PlmzVQHJ3J_C1x92&q=85&s=0db73a3303ed1001c39eccf6420ff850" alt="" width={417} data-path="images/fps-animation-pack/unity/3bb1dfb2d7c55d4a00e4.png" />
</Frame>

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

<Frame caption={"Vertex groups."}>
  <img src="https://mintcdn.com/kinemation/PlmzVQHJ3J_C1x92/images/fps-animation-pack/unity/6c0b6a251b63180b86bc.png?fit=max&auto=format&n=PlmzVQHJ3J_C1x92&q=85&s=65e1cb708d407e608316250927b745b8" alt="" width={1717} data-path="images/fps-animation-pack/unity/6c0b6a251b63180b86bc.png" />
</Frame>

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:

<Frame caption={"Perfectly aligned weapons."}>
  <img src="https://mintcdn.com/kinemation/PlmzVQHJ3J_C1x92/images/fps-animation-pack/unity/a5e69cb887e1c80bc0bc.png?fit=max&auto=format&n=PlmzVQHJ3J_C1x92&q=85&s=36d672486e0d1dc1d5149544d9a41865" alt="" width={563} data-path="images/fps-animation-pack/unity/a5e69cb887e1c80bc0bc.png" />
</Frame>

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

<Frame caption={"Parenting model to the skeleton."}>
  <img src="https://mintcdn.com/kinemation/PlmzVQHJ3J_C1x92/images/fps-animation-pack/unity/969837a0eecde6ea8724.png?fit=max&auto=format&n=PlmzVQHJ3J_C1x92&q=85&s=557eb10687af4f9be19c287a4a96dd18" alt="" width={563} data-path="images/fps-animation-pack/unity/969837a0eecde6ea8724.png" />
</Frame>

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

<Frame caption={"Export settings."}>
  <img src="https://mintcdn.com/kinemation/PlmzVQHJ3J_C1x92/images/fps-animation-pack/unity/62ce3f02de1e7ce49269.png?fit=max&auto=format&n=PlmzVQHJ3J_C1x92&q=85&s=e3788ef7234df11208ea6ecaf63df6d4" alt="" width={227} data-path="images/fps-animation-pack/unity/62ce3f02de1e7ce49269.png" />
</Frame>

## 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:

<Frame caption={"Weapon components."}>
  <img src="https://mintcdn.com/kinemation/PlmzVQHJ3J_C1x92/images/fps-animation-pack/unity/f4db6fdc8f5f6a95b5ab.png?fit=max&auto=format&n=PlmzVQHJ3J_C1x92&q=85&s=a58f43336ce2a1027f3c4a450bb4beb3" alt="" width={369} data-path="images/fps-animation-pack/unity/f4db6fdc8f5f6a95b5ab.png" />
</Frame>
