Weapon Manager - How would you approach this in UE?

I have been a Unity developer for a while, and have only recently started transitioning to Unreal Engine.

I am trying to create a weapon manager system using both C++ and blueprints.

I am having an issue with how I am supposed to approach this, more specifically I am having an issue with understanding how I can achieve the same functionality as in Unity, maybe this is why I am struggling with this.

I created a weapon class that is an actor, and a weapon manager class that is an actor component which will be attached to the player through blueprints.

In the weapon manager, I created three variables: PrimaryWeapon, SecondaryWeapon, and CurrentWeapon. All of which are pointers of type Weapon class.

I then created a Weapon blueprint in the content browser called “BP_Weapon_M9”.

When I added the weapon manager component to the player, I wanted to assign the “BP_Weapon_M9” to the PrimaryWeapon field, but the dropdown shows nothing.

Is the way I am approaching this flawed or am I missing something critical?

Thank you.

Hey @zombieqtr1! Welcome to the forums!

Since you’re using both C++ and blueprints, would you mind differentiating what you’re using for which? And some screenshots? :stuck_out_tongue: Because the THING is… As far as I can tell, from what you’ve told me, you should be 100% in the clear and that should appear in the dropdown. Just a weird thought… You did Save and Compile the BP_Weapon_M9, the Character BP, and the Weapon Manager Component, right?

Thank you for your reply.

Managed to create a complete weapon manager system that functions the way I wanted.

I was trying to use class references without spawning them! that was the issue! Major mistake on my part.

Now I have two slots, the primary and secondary weapons class reference slots and the object reference slots. I spawn them in at the beginning and switch accordingly, and I can also assign them in the blueprint, when I select the weapon manager component.

Learning allot so far, and enjoying every bit of the process, I love unreal engine 5!


1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.