- Home /
Plane Mesh Collider doesn't stop Capsule ... sometimes.
Hi everyone.
I've got a problem with the physics interaction between the inbuilt plane with its mesh collider and a capsule collider.
The plane is horizontal like a terrain, position at (0, 0, 0). The capsule is at its default orientation, just above the exact centre of the plane (0, 1.5, 0).
With the plane at (1, 1, 1) scale, the capsule stops on it perfectly fine. But with the plane at (2, 1, 2) scale, the capsule falls right through it. I can literally stop playing, change the scale and play it again to replicate this.
It only happens if both are at the 0 on the x and z axes. It only happens with a capsule, sphere and cube work fine. It only happens on some specific scales. It doesn't happen at (3, 1, 3) scale for example.
This makes no sense to me.
Does anyone have any ideas and can anyone replicate it?
Answer by Statement · Dec 06, 2011 at 09:16 AM
I can replicate it, yes.
It's probably due to floating point rounding errors. What you are experiencing is tunneling which happens if the object slide through the volume of the object. It's a common problem with physics and collision detection. A plane offer no volume and is unfortunately not ideal for collision stoppers. What you can try doing is setting the Collision Detection of your capsule to Continous, replacing the Mesh Collider with a Box Collider or attempting to increase PhysicsManager Solver Iteration Count.
Boxes and Spheres will also fall through if you put them high up and let them fall down with great speeds for instance. I am sure there exist some borderline positions for the cube and sphere close to the plane as well, although it might not be easy to find those "awkward spots".
Your answer
Follow this Question
Related Questions
In which cases Mesh Colliders they should not be used? 1 Answer
Physics sphere slows down when rolling on two wire rails like pinball machine wireform ramp 0 Answers
Compute mesh inertia tensor failed - NOT the usual problem 0 Answers
Realistic 2D flight physics? 0 Answers
CapsuleCast consistent error in size 1 Answer