Track how many objects have passed that point

I have car objects moving along a path, when each car passes a certain point I want to have an integer increment so I can track how many cars have passed that point.

var fwd = transform.TransformDirection (Vector3.forward);
	if (Physics.Raycast (transform.position, fwd, 0.35)) {

			carCounter++;
			Debug.Log(carCounter);
			
	}

This is the code I have so far, I works but sometimes it increments twice when only 1 car has passed. What am I doing wrong? is there a better way?

Thank you

I would not go about it in the way you are doing. I would have a big Trigger covering the “Point” which will add one to your carCounter var in its OnTriggerEnter() funtion when the object’s tag that raises the trigger event is “Car”(Or whatever tag you have given to your car objects).