Creating a Collectable

Niraj Karki
Jul 30, 2021

2.5D Game Development

Objective: Create a collectable gameobject

First start with either creating a game object and designing it or importing an asset. Here, I created my own coin.

Then enable the trigger in the collider component, add a new script and add a rigidbody gameobject with gravity set to false.

Then inside the coin script, create a OnTriggerEnter function where it identifies the object as Player when in contact and then destroys itself. Here, we can also increase the coin count or have other features but that is a article for later.

And this is the final result.

--

--