Download

Assistance needed for item pickups C++

Hi All,

I am new to Unreal but have been working hard at learning it and C++ over he past few months. I am having a bit of an issue when it come to picking up an item. Currently I have a weapon class in my game and the weapons are basically auto-equipped when a character overlaps with them. That functionality is fine for me at this point but the problem starts when another character overlaps with the weapon currently equipped by the first player. The other player then snatches it and equips from the first (interesting game play but not what I am looking for).

Any idea on how to set the weapon to no longer be subject to the equip function I created once its been equipped? (I tried to make a copy of the weapon once equipped and then destroy the original but was unable to make it work correctly.)

Please use C++ instead of blueprints.

I am just looking to be pointed in the right direction and not perfect cut/paste code for my project as it helps me learn.

Thank you all!!

I figured it out. I incorporated a bool that would skip my equip function after the first equip. There is probably a better way but its working as I wanted now. Thanks to all who looked at this