

I am trying to implement a weapon inventory system
*The first screenshot is the backup/stable version. The second is the current version that's being tested and modified.*
I basically want my player to always have two weapons, one primary (like a rifle) and one secondary (like a pistol or an SMG).
I implemented the system of picking up and dropping weapon from the first screenshot a few months ago by following a tutorial (I was a beginner and didn't yet learn that following tutorials blindly is a pretty bad practice. Cut me some slack) and then I added the logic of saving one primary and one secondary weapon in inventory today. However, this still doesn't allow me to switch the current weapon between the two saved in the inventory as I always drop the current weapon even when it's saved in the inventory.
This is where the second screenshot (the test version) comes into play. I tried to immediately save the weapon to pick up into it's designated slot based on its ENUM Weapon Class value (whether it's primary or secondary), but I realized the "current weapon" variable the inventory logic uses is empty. How do I instead get the ENUM Weapon Class value directly from the weapon while it's on the ground and save it to the inventory BEFORE I actually pick it up to my hand? Also would the switching current weapon logic work?
(*Excuse me if I'm asking obvious questions. I am still a beginner and not yet very knowledgable of UE5*)