# Firearm

Before networking a firearm, complete the [Firearm](/fps-framework/tutorials/character/firearm.md) setup in the base FPS Framework first ensure it works correctly there, then follow the FPSF Pro networking steps to network the weapon.

Now, you can follow the same process used for the **FPS Controller** and **Inventory**. Simply right-click on the **Firearm** component, then select **Setup > Network Components**.

<figure><img src="/files/KmVqLQPS6enpFMuLMkoQ" alt=""><figcaption></figcaption></figure>

This will add NetworkFirearm component which has 2 fileds, Network Pickable and Network Projectile. \
Let's starts with Network Projectile. Find the default Projectile prefab or your own projectle, right click Setup > Network Components then make it a prefab and assgin it to Network Projectile field.

<figure><img src="/files/zAlQZYeRGZGSR7oeczkW" alt=""><figcaption></figcaption></figure>

For NetworkPickable see [Pickable ](/fps-framework/tutorials-pro-only/systems/interactions-manager/pickable.md)for Pro asset and assgin it to Network Pickable.

## Multiplayer View

If you’re using custom meshes or animations for other players to see, attach the **PlayerItemsLocomotion** component to handle their synchronization properly.

{% hint style="info" %}
This component is designed for setups that use a custom character model with a unique rig and animation set, separate from the firearm animations used in the **Inventory** system.
{% endhint %}

<figure><img src="/files/v0B7nxZmAAHwYAXNSxKz" alt=""><figcaption></figcaption></figure>

The **TargetItem** field should reference the prefab of your networked firearm. This allows the component to detect when the player is holding that specific item. If the player is holding it, the firearm’s mesh becomes visible to other players, while the active weapon in the inventory is hidden.

Other fields are self explantory:

* The **PlayerAttachmentsManager** is a centralized manager that handles enabling and disabling items across the network. Attach it to the player object this allows weapons to check whether they should be active or not based on the manager’s state.
* The **CasingEjectionPort** defines the point where shell casings are ejected. Adjust its position and rotation to match the location and direction of your custom mesh for accurate visual alignment.
* The **LocomotionAnimationLayer** specifies which animator layer the weapon controls. Its weight is automatically set to **0** when the item is inactive and to **1** when the item becomes active.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://akila.gitbook.io/fps-framework/tutorials-pro-only/character/firearm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
