Wierd problem with the coins, plz help

So the problem is:

If I load into level 2 or 3 instantly instead of starting from level 1 the coin pickups work just fine. But if I for example start from level 1 (which I don’t have any coins in) and complete the level and then go over to level 2, I can pick up the coins and the coin disappears, the sound effect plays but the score doesn’t increase. The same thing happens if I start in level 2 and pick up the coins there the score increases as it should but then when I complete the level and pick up coins in level 3 it doesn’t work.

Plz help


Welcome to our community! :slight_smile:

Please note, it’s better to copy/paste your code and apply the code fencing characters, rather than using screenshots. Screenshots are ideal for displaying specific details from within a game engine editor or even error messages, but for code, they tend to be less readable, especially on mobile devices which can require extensive zooming and scrolling.

You also prevent those that may offer to help you the ability to copy/paste part of your code back to you with suggestions and/or corrections, meaning that they would need to type a potentially lengthy response. You will often find that people are more likely to respond to your questions if you make it as easy as possible for them to do so.

Check if your “singleton” calls gameObject.SetActive(false); in the same if-block where Destroy(gameObject); gets called. If there isn’t that line of code, add it.

Hope this helps. :slight_smile:

See also:

Thanks, i will keep that in mind for future questions

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms