+ 1
Pick-up script
I need to make a script that enables a character to pick something up off the ground then for it to stay with them on the click of a button.
2 Answers
0
Assuming you've built a proper class hierarchy for your gameobjects, you can create an array with your Item parent class as the elements. This will act as your characters inventory. Then use the Unity Engines built-in OnClick() method to have the item removed from the environment and placed in your inventory.
Not sure if you've been to the Unity forums yet, but they're a great resource for answers to questions like yours.
0
https://youtu.be/9tePzyL6dgc
This should help a bit. There several videos about item pickup in this video series.