Hi all I am developing a game with two objects, both are using RigidBody 2D and BoxCollider 2D. I want to get the score for the number of collisions of those two objects. so, for each collision, score++ occurs in the script attached.
The problem I am facing is when a collision occur, the script is called several times as long as the objects touch each other. so that score is getting high. Does there any way to eliminate this behavior? So that only once the collision is counted.