[SOLVED] Coin Counter Problem Help please!

Hello everyone.

I have a problem with the Coin Counter of my prototype platformer game that I’m learning how to make. When the player collects many coins at the same time, the Counter does not count them all. Do you know how to fix that error?

I have created 30 coins to collect with the player while he is jumping on some platforms. The player is supposed to collect 30 coins, but the counter only counts 27 or 29 coins, sometimes less. Why does this happen?

I assume you have a “player collision with coin” type event, with action along the lines of “score += 1”? In which case, I believe that GDevelop detects the simultaneous coin collision and puts the coins into a type of list.

You can tackle that list in 2 ways, depending on whether you want to do much more with each coin :

  1. Change the score increment by Count(coin)


  1. Create a subevent “For each coin”, and move the action from the collision event to this sub event.



1 Like

Hello MrMen. Thank you for your interest in wanting to help me correct this error with the coin counter. This is the screenshot of the event from my prototype project. I tried to do it as you told me, but it didn’t work for me. Maybe I missed doing something else.

Bug in coin count 2

There are a total of 30 coins. The counter is only counting me 28 coins.

Your “For each” event is empty and does absolutely nothing.

Problem solved. The coin counter bug has been fixed. I have repeated the simulation of collecting all 30 coins several times and it works without problems.