PickUp Optimization

What exactly do you mean by “target” the pick up? Once the pick up is in the crosshairs? Are you clicking on the pick up? I am not sure exactly what you are trying to do here because the code seems very complex for something as simple as “pick up” object when nearby. Not sure why you even need an array if you are adding and removing the item in that array based off whether or not the player is overlapping it. Is your player going to overlap multiple “pick ups” at once?