Score randomly adds 1 to 5 points

The score seems to randomly update the score by 1 to 5 points when the bottle or plastic rings are collected. I only want it to be updated by 1. I have looked through my code with my team and cannot figure out what the problem. Any help would be grateful and appreciated.

When i attach the zip file to this post, it uploads, then disappears .

It could be related to multiple collision events on the same frame. A way to fix this is for the coin script to set self.collected = true and then on its next update if self.collected == true send signal to collect to player script and destroy coin.

What message you use. You can get multiple contact_point_response for one collision

I had this happen to me, and I think it was because the file was too large. Make sure you exclude the “.git”, “.internal”, and “build” folders when you zip a project.

Thanks everyone for the quick responses. I took the advice and changed the “self.collected” like the collect coins tutorial.

1 Like