How do I solve the Box Collider (3D) Edge / Corner Collisions problem?

I posted a similar question in the unity forums 10 days ago and haven’t had any responses at this point.

http://forum.unity3d.com/threads/box-collider-3d-collisions-corner-collisions-edge-collision-issue.298752/

In short my level is made up of box colliders (3D). My player (and other objects) are using non-rotating Box Colliders (3D). I’m not sure how to solve my issue with Unity Physics when the player or other objects hit the ‘edge’ of a Box Collider, even though it is next to another box collider and needs to act as if it’s 1 object.

I am already combining as many Box Colliders together as possible into 1, but there are instances I cannot avoid where this will still occur.

I’d prefer to use Unity to detect collisions as from what I’ve read PhysX is extremely optimized.
Is it possible or will I have to check for collisions using Ray Casts every FixedUpdate() on my moving GameObjects and reflect their velocities appropriately, thus not benefitting from PhysX?

Are there other options / solutions I can look at?

Edit->Project Settings->Physics
Inspector will show PhysicsManager
Set ‘Default Contact Offset’ from 0.01 to 0.001 (I use 0.0001)

This WILL fix it as I use a ton of cubes in a 3D cubic tile based world.

I’ve never faced this particular dilemma, but I know a teeny bit about the physics system’s many quirks. Unfortunately, the issue(s) you seem to be describing are inherent nuances of the physics sim. Someone correct me if I’m wrong. Just as floating point precision is finite, so too is the simulation accuracy.

I’m confused by your stated requirements, such as the non-rotating box collider for the player. Using a non-rotating sphere collider of the same diameter might (probably would!) mitigate these issues a great deal. Also, proper masses, forces, frictions, and bounce factors go a long way to polishing the sim.

It’s perfectly fine, by the way, to blend your behaviors among raycasting, triggers, and actual collision reactions. Any quality, robust simulation has some extra sensors and actuators working unbeknownst to the player! As long as your physics equations are sound and your various sensors and actuators are sufficiently competent, it can all work really well.

Hey,

I know this problem well and I’m working on a 2D game, currently. While I’m not using 3D collisions, my solution may help point you in the right direction. I ended up having to use the ‘Edge Collider 2D’ on my player, rather than the box collider. With each side covered by its own edge collider I’ve found that I don’t get the… sticking to the corner of a block on the floor or walls. It also lets your character’s feet have a different physics material to your character’s sides.

Good luck

I had a similar problem, for anyone who still needs help, my solution was to use box renderers with children quad colliders along the surfaces you want to collide with. even though the edges are flush and shouldn’t collide, they do. By excluding these surfaces, the object will never wrongly catch on them.

For everyone who still has this problem (I was searching for a solution for ~1hr):

what @AlwaysSunny stated is a great way to deal with this (in most cases).
Try to have a gap of e.g. 0,01 between your (box-)colliders, so they don’t directly touch each other - your character will not glitch through the edges anymore.

Also, keep in mind that the speed of your character has an influence on the clipping.