Object is falling through floor

Hello *,

in my application some objects are falling from the sky to a floor. The floor has a “mesh collider”, the falling objects “Box colliders”.

Sometimes a falling object does not collide with the floor but falls through it.

Once the objects is on the floor it can move around without falling through, the mesh itself does not have little holes or missing polygones.

If I will change (for testing) the collider of the floor to a box collider everything works fine(in the final game the floor needs to have a mesh collider).

Does anybody has the same problem and found a solution?

Thanks,
Ulrich

This problem is very common. It happens with objects that move very fast (where very fast means that they travel more distance over one frame than their own size). It is most often encountered with bullets, but can happen with any type of fast-traveling object.

The typical solution is to raycast in the direction of the velocity and place the object on the hit location when a hit is found.

How fast is the box falling?

If its moving too fast, it can “skip” collision between physics updates. Thats a common problem with fixed step physics engines.

The box collider is a volume, rather than a plane, so is more likely to detect the collision.

Easiest solution is reducing the timestep in Project settings->Time. This can reduce performance.

The Objects are falling with a moderate velocity (no bullet speed or so).

Now I have found out that the collision is more accurate if I turn on “Convex” in the Mesh collider.

Is there a little sample available which shows a solution with raycast? I’m a newbie in Unity3D.

Thank you,
Ulrich

Great!

Thank you,
Ulrich