How can I pickup and move items with script?

makelchs

New member
Hi I'm making feature about NPC who pickup items and move to storage and move that item to it
It was easy to pickup with player but I don't know how to do it with NPC
Is there any scripts to do this?
 
Hello makelchs.
There should be no difference bettwen picking up as a player or an NPC.

Picking up items is done by the InventoryInteractor component, you can set it to AutoInteract to pickup simply by walking into the pickup if you want for your NPC. It uses a Layer mask make sure that your pickup collider is set on a Layer that the pickups can interact with the NPC.
Lear more here:
And here:

Let me know if that helps :)
 
Back
Top