Now when you know how to animate and move your character, your next question must be Hey, how to collect coins? Well, maybe I'm wrong. But collecting coins is one of the most common part of the game. And I gave you 99% that you first game needs someone collecting something. All right, so let's look at our coin and I want to make it a little bit smaller because right now, it's kind of big. So I use rect tool.
All right, good. Now I want to move it. Right here, right here. Okay, so let's add a collider to our coin. It should be a circle Collider. Where is it?
Okay, almost perfect. Okay, good. Now we need to create a new tag. Go to tag, tag, coin. Alright, go back to our coin tag, coin. So now our coin has a collider and is tagged as coin.
Let's duplicate it. Right click Duplicate, right click Duplicate and creating a few more coins that way. And now, as I duplicated the first one, all these coins have colliders and And they are tagged as coin. All right, let's go back to our script and go inside our function on trigger. Versus on yeah on trigger Enter to D. Alright, so here we have checked if the object is tagged as ground, and let's make another check in. If.
So we have almost the same thing here. If our trigger collider touches the collider with the tag coin, then other collider is destroyed. So it will be this droid and disappeared from our scene. All right, let's save and check it. Yay. Our coins disappeared good