Quickly moving cubes fall through quad floor

I was playing around with physics in Unity, and ran into my first problem.

I have a very big quad (100x100 units) rotated to become a floor, on which I want cubes to fall.
These cubes are randomly spawned 100 to 2500 units above the floor, and speed towards it at intense speed.

While some cubes correctly bounce of the quad, many cubes fall right through it. It is even seen how some crash intersectingly into the quad and then fall through.

Both the cubes and the quad use box colliders, fitted tightly around the meshes (I tried mesh colliders before, but they had the same issue).

My theory is that the higher-spawned cubes rush towards the quad in such an intense speed that the collision is not detected anymore. However, I’d expect from physics that the way from one frame to the next is correctly checked for intersecting objects and that even infinitely fast objects would bounce back.

If any more information is required, I uploaded the playground project [61466-testproject.zip|61466].

The script creating the cubes is as follows:

private void Start()
    for (int i = 0; i < 2500; i++)
        GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
        cube.transform.position = new Vector3(Random.Range(-100, 100), Random.Range(100, 2500),
            Random.Range(-100, 100));
        cube.transform.rotation = Random.rotationUniform;

Rigidbody collision detection will be “discrete” by default… And you may not want to up it to continuous for performance reasons…
Yor best bet would be to increase the colider thickness on the floor.

Unfortunately Unity’s physics don’t currently handle this. If you have objects moving fast enough then the collision will be missed. You can decrease the time-step for physics calculations, but even that won’t handle everything. You usually end up having to implement your own solution or use something like this.


If a fast moving object goes through the collider between frames nothing will happen as if the collider wan’t there at all!