How to make a coin counter?

Correct me if i am wrong, i don’t know the word for this, but i think it’s “counter”. Yesterday i though that would be a nice idea to make a platform game, as it is very easy to make. Actually, most of the game is done and it is pretty nice, but i am having a problem with making a “coin counter”.

I want to make a script that kinda detects or something like that when the player hit the objects in my scene that are tagged as “G”, and add one number to each coin that is hit. Example:

The player already have 30G. He touches 8 more coins. The Counter is now 38G.

Do someone know how to do this? Oh, i also wanted to make a UI that would show the player’s current number of G but i don’t know if it is possible.

Here is a tutorial for the coins disappearing on contact:


Now here is how to do a ‘counter’:

I figure this is better than tying to exlpain a script that I created a year and a half ago, so just follow these tutorials…

I hope this is what you were looking for :smiley: