Falling on coin add double points!

Hello,

I notice that if you fall from above on a coin you get 2xPoints.
You can also notice that during the video at 11:18 → 3 coins but 400 points!
I think is a problem caused by the 2 Colliders on the Player but i haven’t figured out how to solve it!

Thanks in advance for the response,
Germano.

Hi Germano,

Welcome to our community! :slight_smile:

You could add a bool variable to your coin script and name it wasCollected or something like that. When the coin was collected, you set the bool to true. In your collision/trigger method, you check the value of the variable before adding points.

Did this help you fix the problem?


See also:

The above code will resolve your problem

Happy Coding :slight_smile:

1 Like

Hi Premkumar,

Welcome to our community, and thanks for sharing your solution! :slight_smile:

1 Like

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

Privacy & Terms