> For the complete documentation index, see [llms.txt](https://docs.infimagames.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.infimagames.com/product/tactical-fps-animation-packs/guides-and-tutorials/editor/add-a-weapon-and-scopes.md).

# How to Customize a Weapon's Settings and Fit a Scope

Customize a weapon's settings in Unreal Engine 5, such as its fire modes and scope, using your own copy of its data asset.

{% hint style="info" %}
This page is about our demo showcase Blueprints. The Blueprints are mainly meant for showcase purposes, and aren't intended to be used as an FPS template out of the box.
{% endhint %}

#### Table of Contents

* [Introduction](#introduction)
* [Before You Start](#before-you-start)
* [Customize a Weapon's Settings](#customize-a-weapons-settings)
* [Fit a Scope](#fit-a-scope)
* [Your Own Scope Mesh](#your-own-scope-mesh)
* [The Scoped Animations](#the-scoped-animations)
* [Random Attachments](#random-attachments)

***

### Introduction

***

In this guide, I'll show you how to customize one of our weapons' settings and fit a scope on it. Each weapon in the showcase is a data asset, so you work in your own copy of it, which keeps playing the pack's animations.

I'll use the Pistol. The steps are the same for the Assault Rifle.

For a different look, with a weapon model of your own, see [How to Replace the Weapon With a Custom Model](https://docs.infimagames.com/product/tactical-fps-animation-packs/guides-and-tutorials/editor/how-to-replace-the-weapon-with-a-custom-model-in-unreal-engine-5-blender-to-ue5.md).

***

### Before You Start

***

{% hint style="warning" %}
Work in your own copy of the data asset, in a folder of your own outside the pack's folders. An update can replace the original.
{% endhint %}

***

### Customize a Weapon's Settings

***

{% stepper %}
{% step %}

#### Duplicate the Data Asset

1. Open `Weapons/Pistol/Demo/Data`.
2. Right-click `DA_TFA_Pistol` and select **Duplicate**.
3. Move the copy into a folder of your own and name it, such as `DA_MyPistol`.

<div align="left" data-with-frame="true"><figure><img src="https://3271331258-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuuZjeeFspZ4mvcxHpS6M%2Fuploads%2F5mxoomwsFXJXNDU89tRr%2FSL-AWS-01.png?alt=media&amp;token=cbc7f95d-d38c-47a6-a658-46372bceaf25" alt="" width="470"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Change Something You'll See

1. Open your copy.
2. Under **Weapon > Firing**, remove the last entry from **Fire Modes**, which is **Auto**.

Your Pistol now only switches between Safety and Semi.

<div align="left" data-with-frame="true"><figure><img src="https://3271331258-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuuZjeeFspZ4mvcxHpS6M%2Fuploads%2FJbO3Duk3WIXjhJt49zwC%2FSL-AWS-02.png?alt=media&amp;token=4bca8b1a-aa7b-4647-a657-7f880f79860a" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Point the Demo Character at Your Copy

1. Open the demo map, `L_TFA_Pistol_Showcase`, and select the character in it.
2. In the Details panel, select its **WeaponComponent**.
3. Then set **Weapon Config** to your copy of the data asset.

The demo map points at the original, so you won't see your changes without this.

{% hint style="warning" %}
Don't save the map, or save it as a copy. An update replaces ours.
{% endhint %}

<div align="left" data-with-frame="true"><figure><img src="https://3271331258-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuuZjeeFspZ4mvcxHpS6M%2Fuploads%2F2MGSk35x2HNNZMtZTV07%2FSL-AWS-03.png?alt=media&amp;token=ff72a753-0307-44bc-97be-e2eb82ae2dcf" alt="" width="470"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Test It in Play

1. Hit **Play**.
2. Press **V** to step through the fire modes.
3. Hold the trigger.

Auto is gone, so every pull fires a single round.
{% endstep %}
{% endstepper %}

That's it! Everything else about the weapon is a field in the same data asset, so you can try more changes the same way.

<details>

<summary>The main fields in the data asset</summary>

| Where                                       | What it changes                                                                                                                                                                                                  |
| ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Meshes > Weapon                             | The receiver and its parts, such as the magazine, sights and laser.                                                                                                                                              |
| Meshes > Scope                              | The scope and what happens to the iron sights while it's on. See [Fit a Scope](#fit-a-scope).                                                                                                                    |
| Meshes > Attachment Options                 | What N picks in the showcase. See [Random Attachments](#random-attachments).                                                                                                                                     |
| Weapon > Firing                             | Fire Modes, Fire Rate RPM, the burst count, recoil and the muzzle flash.                                                                                                                                         |
| Weapon > Left Hand IK                       | Keeps the left hand on the weapon. Turn it off for a one-handed weapon.                                                                                                                                          |
| Weapon > Can Aim Down Sights                | Off for a weapon without sights.                                                                                                                                                                                 |
| Grips                                       | The weapon's grips, and the one it starts with. See [How to Set Up Grips and Canted Aim](https://docs.infimagames.com/product/tactical-fps-animation-packs/guides-and-tutorials/editor/grips-and-canted-aim.md). |
| Procedural Offsets > Offset Aim Down Sights | How close the weapon comes to the camera when you aim.                                                                                                                                                           |
| Animation                                   | Which of the pack's montages and sequences play for each action.                                                                                                                                                 |

Every field is listed in [Base Config (BP\_TFA\_BaseConfig)](https://docs.infimagames.com/product/tactical-fps-animation-packs/guides-and-tutorials/reference/blueprints/base-config-bp_tfa_baseconfig.md).

</details>

{% hint style="info" %}
Anything a weapon doesn't have is skipped. Leave a montage or a list empty and the action never plays.
{% endhint %}

***

### Fit a Scope

***

Both weapons come with a scope, `SM_TFA_Pistol_ATT_Scope` and `SM_TFA_AR_ATT_Scope`. Their data assets have the rest filled in already, so one field turns it on.

{% stepper %}
{% step %}

#### Open Your Copy of the Data Asset

Find your copy, `DA_MyPistol`, and open it.
{% endstep %}

{% step %}

#### Set Mesh Scope

Under **Meshes > Scope**, set **Mesh Scope** to `SM_TFA_Pistol_ATT_Scope`. For the Assault Rifle, it's `SM_TFA_AR_ATT_Scope`.

<div align="left" data-with-frame="true"><figure><img src="https://3271331258-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuuZjeeFspZ4mvcxHpS6M%2Fuploads%2FUEdArB4x48hyyH6OMUN0%2FSL-AWS-04.png?alt=media&amp;token=c854233b-8f13-4037-bc72-c33d003a130f" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Test It in Play

1. Hit **Play** in the demo map.
2. Aim.

The reticle sits in the center of the screen.

<div align="left"><figure><img src="https://3271331258-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuuZjeeFspZ4mvcxHpS6M%2Fuploads%2Ftlu6AWGaYn8EUBXLJil6%2FSL-AWS-05.png?alt=media&amp;token=8994d896-566a-4140-be92-522af3701050" alt=""><figcaption></figcaption></figure></div>
{% endstep %}
{% endstepper %}

The Pistol's scope mounts where the rear sight was, so it hides the rear sight. The Assault Rifle's swaps its iron sights for the folded ones.

<details>

<summary>The scope fields</summary>

| Field                                                           | What it does                                                                                                                                                          |
| --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Mesh Scope**                                                  | The scope, fitted at Names > Sockets > **Socket Scope**. Left empty, no scope is fitted.                                                                              |
| **Scope Hides Rear Sight**, **Scope Hides Front Sight**         | Hide that iron sight while the scope is fitted.                                                                                                                       |
| **Mesh Sight Rear with Scope**, **Mesh Sight Front with Scope** | Swap that iron sight for another mesh while the scope is fitted, at the same socket. Left empty, the normal sight stays. A sight set to both hide and swap is hidden. |
| **Socket Scope Aim Point**                                      | The socket at the center of the reticle, `SOCKET_AimPoint` by default.                                                                                                |

</details>

<details>

<summary>How the scope lines itself up</summary>

While you aim in first person, the weapon moves so the aim point sits in the center of the screen. It measures the first time you aim with each weapon, scope, grip and stance, then keeps the result. The breathing still moves the sights.

**Offset Aim Down Sights** still sets how close the weapon comes to the camera. A scope without the aim point socket lines up on the front sight's **Socket Iron Sight Aim Point** instead, and without either socket the weapon uses Offset Aim Down Sights alone. Iron sights line up the same way, on the socket at the tip of the front sight's post.

</details>

***

### Your Own Scope Mesh

***

{% stepper %}
{% step %}

#### Add the Aim Point Socket

Add a socket named `SOCKET_AimPoint` to the scope mesh at the center of the reticle, with Z up. That's a red dot's dot, or a holographic sight's ring.

<div align="left" data-with-frame="true"><figure><img src="https://3271331258-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuuZjeeFspZ4mvcxHpS6M%2Fuploads%2FbZ9c7BnhX19DioVaXJZ9%2FSL-AWS-06.png?alt=media&amp;token=716d0970-1d1e-466b-8f16-bb9ed1f6006b" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Set Mesh Scope

Set the mesh as **Mesh Scope** in your copy of the data asset.
{% endstep %}

{% step %}

#### Set Socket Scope

Set **Socket Scope** to the receiver socket it mounts on.
{% endstep %}

{% step %}

#### Test It in Play

Hit **Play** and aim. If the reticle sits off center, check the socket's position and that Z points up.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
**From Blender**

Unreal's FBX import strips one `SOCKET_` from an empty's name. Name the empty `SOCKET_SOCKET_AimPoint` and it arrives as the socket `SOCKET_AimPoint`.
{% endhint %}

***

### The Scoped Animations

***

The Pistol's scope sits where the hand passes in some of its animations, so it has scoped versions of these.

* The equip and the empty equip.
* The inspect (not the full inspect).
* The jam clears.

They play on their own while the scope is fitted, so there's nothing to set up. The Assault Rifle's scope doesn't get in the way, so it has none.

<details>

<summary>How a scoped version is picked</summary>

An **Actions** entry named `<Action>_Scope`, such as `Equip_Scope`, plays in place of the action while a scope is fitted. With an empty weapon the order is `<Action>_Empty_Scope`, then `<Action>_Empty`, then `<Action>_Scope`, then the action. The jam clears have their own lists, **FP and TP Malfunctions Scope** and **FP and TP WEP Malfunctions Scope**.

</details>

***

### Random Attachments

***

Press **N** in the showcase to fit a random set of attachments, such as a different optic, laser or barrel length, and a random grip. The picks only change the spawned weapon, never your data asset.

| Weapon        | N picks                                                                                                           |
| ------------- | ----------------------------------------------------------------------------------------------------------------- |
| Pistol        | An optic, a laser, a silencer and a length (Short, Default or Extended, with the slide, barrel and rail together) |
| Assault Rifle | An optic, a laser, a silencer and a handguard                                                                     |

<details>

<summary>Change what N picks</summary>

The fields are under **Meshes > Attachment Options** in your copy of the data asset.

1. Add an entry to **Attachment Choices** for each thing you want picked, for example `Optic` or `Length`.
2. Give each choice its options. An option sets one or more attachment slots at once, so a slide can bring its matching barrel and rail with it. An option with an empty mesh removes that attachment, which is how "no scope" works.
3. **Randomize Grip** is on by default, so N also picks one of the **Grips**, or the default hold. Untick it to keep the current grip.

</details>

<details>

<summary>The bounce when the attachments change</summary>

In first person the weapon gives a little bounce when the attachments change. It's procedural, under **Procedural Offsets > Attachment Change**.

| Field                                 | What it does                                                                                                                |
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| **Attachment Change Bounce Strength** | Scales the whole bounce. 1 by default, 0 turns it off.                                                                      |
| **Attachment Bounce Time**            | How long the bounce takes to settle. Longer feels heavier and slower.                                                       |
| **Attachment Bounce Overshoot**       | How far it swings back past rest after the first dip, as a part of the dip. 0.25 is a quarter, 0 settles without a rebound. |
| **Attachment Bounce Drop**            | How far the weapon sinks at the deepest point, in cm.                                                                       |
| **Attachment Bounce Pull Back**       | How far it moves back toward the character at the deepest point, in cm.                                                     |
| **Attachment Bounce Dip**             | How far the muzzle tips down at the deepest point, in degrees.                                                              |
| **Attachment Bounce Twist**           | The largest random roll left or right, in degrees.                                                                          |

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.infimagames.com/product/tactical-fps-animation-packs/guides-and-tutorials/editor/add-a-weapon-and-scopes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
