You basically said it yourself in the comment.
make an int variable (collisionCount) then in your collision code just add
void OnCollisionEnter(Collision2D collision)
{
//Do whatever else you need to do here
collisionCount += 1;
}
You could also add a debug or print function if you actually want to see the number of collisions as they occur.
:)
↧