Not all collisions are being detected.

I have a rigidbody cube sat on a plane. I have some code to add upward force to the cube when I press space bar. I’m attempting to clock it’s velocity when it collides with the plane on it’s way back down, so that I can get a sense for falling velocities depending on how high up I send the cube. This is the code I’m using:

void OnCollisionEnter(Collision col){
	
	Debug.Log ("Collision at " + gameObject.rigidbody.velocity);
	
}	

The problem is that it doesn’t actually log every time the cube lands. Only about 1 in 3 times actually show up in the console. Any idea why?

Here’s the code for controlling the cube:

void FixedUpdate () {
	
	float h = Input.GetAxis("Horizontal") * torqueModifier * Time.deltaTime;
    float v = Input.GetAxis("Vertical") * torqueModifier * Time.deltaTime;
    
    gameObject.rigidbody.AddTorque(transform.forward * h);
    gameObject.rigidbody.AddTorque(transform.right * v);
	
	if (Input.GetKeyDown(KeyCode.Space))
	{
		gameObject.rigidbody.AddForce (transform.up * thrustModifier);
	}
}

How large is your collider? If you have fast moving geometry and a thin collider its possible the two objects could pass through each other before the collision is detected. You might try increasing the size of your collider but also look at Fixed Timestep. You might test with a smaller value which will increase the accuracy of game physics at a cost of performance.