Pickup anything

I have been thinking of making a plugin where you can press E on a barrel or some other prefab and then the prefab would be deleted and you will get some scrap added to your inventory.

Can someone help me code that if it's possible 

Have you looked at the plugin called Auto Pickup? From glancing at its docs, it seems to already support a feature where walking near loot barrels will loot them.

ttbMI7hKvdA0eK8.jpg WhiteThunder

Have you looked at the plugin called Auto Pickup? From glancing at its docs, it seems to already support a feature where walking near loot barrels will loot them.

Nope I will look at it now. Thanks!

Merged post

Still not sure how to spawn the prefab and add the pick up function.

You could OnPlayerInput if BUTTONS.USE key was just pressed run raycast and delete the entity, give the scrap.