# Weapon System

**URL:** <https://forums.unrealengine.com/t/weapon-system/1755911>\
**Category:** Blueprint\
**Tags:** ue4-editor, unreal-engine, question\
**Created:** [March 16, 2024, 11:52am UTC](https://forums.unrealengine.com/t/weapon-system/1755911 "2024-03-16T11:52:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GlasyaLabolasHun1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GlasyaLabolasHun1](https://forums.unrealengine.com/u/GlasyaLabolasHun1)\
**Post date:** [March 16, 2024, 11:52am UTC](https://forums.unrealengine.com/t/weapon-system/1755911/1 "2024-03-16T11:52:26Z")

</div>

Hi, I trying to make a weapon system where the player start with a pistol, but can pick up other weapons on the level. When pick up an other weapon I want it to add as a secondary weapon so the player can switch between the pistol and the other weapon. I want the secondary weapon to be replaceable when i find a new weapon, but the pistol not replaceable, always stay as a primary weapon.  
I made a GunBase actor and the weapons and a system that attach the weapon actor to the character and destroy the old one, but can’t get what exactly I want. I watched tutorials but still can’t get it right.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 16, 2024, 12:09pm UTC](https://forums.unrealengine.com/t/weapon-system/1755911/2 "2024-03-16T12:09:26Z")

</div>

Not sure which part of the above you’re having problems with but do consider the following, all pseudoscript:

- the player can reference 3 weapons:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/a/9/7a9862a61adbb8a4e0229cb893b34d14d2c16792.png)

- and the logic could look like so:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/1/9/e1934cf2203dd0b28a4677b50adac9a5d3e24c1e.png)

---

<div class="post-metadata">

**Author:** ![GlasyaLabolasHun1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GlasyaLabolasHun1](https://forums.unrealengine.com/u/GlasyaLabolasHun1)\
**Post date:** [March 16, 2024, 4:01pm UTC](https://forums.unrealengine.com/t/weapon-system/1755911/3 "2024-03-16T16:01:17Z")

</div>

I tried to make it but still not very clear.  
I made this because I want it the player can only pick up weapons when the currently equipped gun is not a pistol, except the first weapon. So always need to swap to secondary weapon to replace it.

 ![Untitled1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/0/9/5094abf0bf4e9b92d0f7d291054d77fc0f48e3f2.png)

I make this to attach the pistol to the back of the player and equip a new swappable weapon. If we don’t have a secondary weapon.

 ![Untitled3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/8/e/48ef54b6022a8aae754c49d48cc707f7b990bb32.png)

and make this to detach and destroy the currently equipped weapon and attach the new weapon, when we already has a secondary weapon.

 ![Untitled2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/c/1/ac1c7785993b4340d3150991e4e0b5a56a9743b5.png)

Unfortunately I can’t detach and destroy the weapons they stay in the players hand when picking up new guns, and how to properly reference the picked weapon and equipped weapon.
