How to count all gameobjects that collided with Box Collider?

Hi,

I have a box collider that follows the camera. I want to count how many gameobjects were collided into the box collider. How do I do that?

Thanks!

Add a counter to the box collider

int noOfHits;

void OnCollisionEnter (Collision col){
    noOfHits++;
}