Move player to location and pickup weapon if in range

Hello,

I’m very bad with programming so please have a bit of patience with me, I’ll try to explain as clear as I can. Also sorry if the way I set this up is very noobish, let me know if there’s anything I misunderstood here.

I’m trying to make a Diablo style movement and pickup system where if I click a location the player moves there and if I clicked an object at that location the player will move there and pickup the object when it is in range. I’m trying something very simple right now, don’t want to use interfaces/inheritance at all just to check for a specific item to make sure this works.

Right now what I’m doing is when I click the player moves there (this is on tick, copying the design from Topdown template)

Then I check what I clicked on and save it in a variable. ( this is every time I click, not on tick)

Next I’m checking if the previously saved variable is the weapon.

My question is: how can I make it that the weapon is only destroyed if the character is in range? Also, where is it better to implement this? All of the above right now are implemented in the Player Controller. I would suppose that for good results I would need to use the Event Tick function for this to make sure it’s always updated ( the moment I’m near the weapon I should know and pick it up if it was previously clicked).

Can anyone give me any tips of the proper way to implement this? Here is a screenshot of the whole thing for better understanding.

Thank you !