How to make Objects collectible HELP PLEASE
I've made a sphere/coin object and i want to know where to insert code in an FPS controller to make said sphere/coin be collected when i collide with it. I do not have a character in place of FPS controller just main Camera and If i need the character i would also like to know if and how i just add that under the FPS controller. I do not know much this is my first unity game. Also how would i make a scoring system and a timer. I need this by Friday
Answer by nathanlink169 · Jun 02, 2017 at 12:16 PM
A very quick Google search of "unity how to make a collectible" will find you the answer that you're looking for, in more detail than I will provide here. Still, here are the basics that you're looking for:
-Add a collider to your collectible. Make sure to check the "Is Trigger" checkbox.
-Add a new script to your collectible, that has a function titled "OnTriggerEnter". This function will take an argument, although this will be easy to find with a little bit of research.
-Inside this function, write the code that you're looking to run.
Like I said, most of these things can be found with a simple google search of "Unity how to -------------"