I have this script with the module collision
which is called when the player collides with any of two cylinders in the scene, the module increments the counter in a text object that in a separate scene that overlays the main scene
import bge
scene = bge.logic.getCurrentScene()
dynamicText = scene.objects['Text']
def collision():
dynamicText.text = str(int(dynamicText.text)+1)
This the logic behind the cylinders that triggers the collision and send the message to the text object to increment the counter.
This is the login in the the text object
The problem is that the counter is incremented twice per collision, and I don’t see an obvious way to filter the second time the module is called.
This is the blend file.