Why is my sphere collider only reporting 1 collision in corners? (pic)

Here is a top-down view of my sphere collider pushed into a corner of my environment mesh collider. It is only reporting one collision, and that is the collision with the north wall; the angled wall is being entirely ignored.

15755-clipping.png

If you continue to move the collider to the left, eventually the physics system kicks in and reports a second collision, but Unity seems to get confused and collisions with both walls will flicker on and off. Flat walls and corners with 90 degree angles work 100% of the time.

Please note that this is NOT a fast-moving rigidbody and I’ve tried every permutation of interpolation, collision detection, kinematic, and penetration penalty.

So, is this some sort of limitation on Unity’s internal collision detection? Does it not like obtuse corners? Does it only check on fixed angles or something? Or have I not thought of something?

Thanks!

If you’re using OnCollisionEnter within a script attached to the sphere, that could be a problem because OnCollisionEnter only detects one collision at a time. Try using a script with each collider in your scene instead of just one on the sphere. This may not be what you’re doing, but that’s what it sounds like. If not, I’ll remove this lol.

@clunk47, i think he not using OnCollisionEnter. unity physics should handle the collisions but it seems it miss the wall for some reason.

@calbar, can you try use capsule colider instead of sphere? you can align it in a way it will work the same as sphere from the top. i saw somewhere that the capsule works better than the sphere to detect collisions…