How to create a weapon equip system?

I’ve been working on a simple first person shooter and I’ve run into a bit of a wall. How do I implement a weapon equip system? I see in the first person example that UE4 provides the weapon logic is hard-wired into the player character. I feel like it would be too sloppy to hard-wire every single weapon I want into my character, so how would I deal with equipping different weapons? For example, say I had an inventory system that I called to that would equip a selected item. When it calls the weapon, how should the weapon be handled by the character? Should I create an actor for every equip able item in the game and attach it to the player camera when called? Or should I create a part of the character that handles what weapon is currently active and derives different variables from the weapon to create it’s behavior? Any pointers would be great. Be it C++ or Blueprint, I’m fairly well versed in both. This is just something I haven’t been able to figure out anywhere else.

There are a few different ways to tackle this problem. The Shooter Game example provides this functionality. I also implemented this in the game I’m working on, using a TArray for the inventory(because TMap isn’t replicated :frowning: ) and creating slots, like in HL2, CS:GO, etc. I defined a maximum number of “slots” and a maximum number of spaces per slot, and then I have the weapon blueprint specify what slot and what order in the slot it wants.

You can find the source code here: NimMod/Source/NimMod at master · Nimgoble/NimMod · GitHub

It’s in NimModCharacter.h/.cpp.

this is the correct answer: http://shootertutorial.com/2016/01/12/uncharted-like-equip-tutorial/