How to Create a Collectable in Unity

Coins, Gems and More….

Objective: download an asset and create a collectable for your game.

For this example I downloaded a 3d battery model for my game and added it to the scene.

With the model in the scene we have to add a collider component to detect the player, in this case the capsule collider is ideal for this asset.

Then We have to create a collectable script and attach it to the collectable. In the script we have to use the function on trigger enter to check the player tag and Update the UI counter and destroy the collectable given the illusion that the player collected it.

And that’s it!!! We have a new collectable for our Unity game.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rusben Guzman

A Software Engineer passionate about game dev and interactive products with Unity. I consider video games to be the artistic expression of programming.