# Help with Enums to change Weapon Type (C++)

**URL:** <https://forums.unrealengine.com/t/help-with-enums-to-change-weapon-type-c/1862026>\
**Category:** Programming & Scripting\
**Tags:** ENUM, unreal-engine\
**Created:** [May 18, 2024, 3:06pm UTC](https://forums.unrealengine.com/t/help-with-enums-to-change-weapon-type-c/1862026 "2024-05-18T15:06:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![enam1984](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@enam1984](https://forums.unrealengine.com/u/enam1984)\
**Post date:** [May 18, 2024, 3:06pm UTC](https://forums.unrealengine.com/t/help-with-enums-to-change-weapon-type-c/1862026/1 "2024-05-18T15:06:05Z")

</div>

Hi all,

I’m looking for some help regarding changing Weapons Poses by passing an Enum.

Firstly, I declared my Enum’s in my Weapon.h class i.e. (pistol, Assault Rifle, Mellee etc )

![WeaponType](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/5/4/c547d68827927abffeb4d498801e4713a8b7f4df.png)

Secondly I created an instance of this Enum in my Weapon.cpp called “EWeaponType WeaponType;” and exposed it to blueprints.  
In the blueprints for each weapon i chose the weapon type enum from a dropdown.

![WeaponTypeInstance](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/9/a/09a4efe55252a35fd1d48fde3c73b7f62bca07e7.png)

In the Anim instance I have access to that WeaponType Enum variable.

 ![AnimInstance](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/9/9/e994a1602c353279d3e639e64defb9f2ddda5058.png)

Regarding the c++, I currently have an Equip function where i could try to call the function for the Weapon Class -\>Weapon Type but i’m under how to do this.

Do I have to somehow create a “get Weapon Type” function and pass it so when I’m running the equip function for a new Weapon equipped, it gets the Weapon Type and updates that variable in the anim instance for the right pose?

 ![Weapon.cpp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/0/8/30842f8f3849be695cfdc1433c9135fcbd8bceeb.png)

This is the issue for me right now

---

<div class="post-metadata">

**Author:** ![enam1984](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@enam1984](https://forums.unrealengine.com/u/enam1984)\
**Post date:** [May 20, 2024, 1:32pm UTC](https://forums.unrealengine.com/t/help-with-enums-to-change-weapon-type-c/1862026/2 "2024-05-20T13:32:02Z")

</div>

bump 😞 😓

---

<div class="post-metadata">

**Author:** ![enam1984](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@enam1984](https://forums.unrealengine.com/u/enam1984)\
**Post date:** [May 23, 2024, 3:25pm UTC](https://forums.unrealengine.com/t/help-with-enums-to-change-weapon-type-c/1862026/3 "2024-05-23T15:25:47Z")

</div>

bump

---

<div class="post-metadata">

**Author:** ![ThomasLTs](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ThomasLTs](https://forums.unrealengine.com/u/ThomasLTs)\
**Post date:** [March 9, 2025, 6:16pm UTC](https://forums.unrealengine.com/t/help-with-enums-to-change-weapon-type-c/1862026/4 "2025-03-09T18:16:46Z")

</div>

Did you find the solution ? Cause i have the same problems 😭

---

<div class="post-metadata">

**Author:** ![SpecZynk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/speczynk/32/1117840_2.png) [@SpecZynk](https://forums.unrealengine.com/u/SpecZynk)\
**Post date:** [March 9, 2025, 7:30pm UTC](https://forums.unrealengine.com/t/help-with-enums-to-change-weapon-type-c/1862026/5 "2025-03-09T19:30:55Z")

</div>

Hi,

At the moment you equip your weapon, also update your AnimBlueprint variable  
`EWeaponType WeaponType`, your AnimBlueprint should also know you equipped another weapon.

May that help you.
