Sphere jumps over Box Collider seams

Helo everyone,

i’m creating a game with a rolling ball driven by forces, which has a rigidbody and a sphere collider attached.
My floor is made with compound box colliders.

Problem:
When the ball rolls over box collider seams it jumps up.
I tried to overlap and to snap them but neither helped…

How can i solve this?

Can anybody help please

thx

Helo again,

in the meanwhile i found a workaround to solve this problem.

Solution: I’ve put a collider as trigger over the affected seams which freezes y position of rigidbody constraints when the ball rolls through.

This is the code:

void OnTriggerStay(Collider other)
{
	other.gameObject.rigidbody.constraints = RigidbodyConstraints.FreezePositionY;
}

void OnTriggerExit(Collider other)
{
	other.gameObject.rigidbody.constraints = RigidbodyConstraints.None;		
}

Unfortunately i didn’t get any answers yet.

For any suggestions or advices → any other “native/better” and not patch ones like mine;) would be appreciated.

thx a lot

I’ve found a really good solution.

Use 2 Colliders. If Mesh collider, typically one convex, one not. Otherwise just make a giant, simplified box collider overtop of your bad seams. When your on top of a collider with seams, you collide with the “giant” collider, otherwise you fall through the giant collider.

In detail:
Put the convex/giant collider on a “seam fix” layer, and the other collider on a “seam bad” layer. Have 2 layers for your “player/ball”. One is the regular player layer, the other is the “player seam fix” layer. Setup your Physics Manager so your player collides with “seam bad” but not “seam fix” and “player seam fix” collides with “seam fix” and not “seam bad”.

In Update, use a BoxCast/SphereCast/RayCast or w/e to determine if your against the “seam bad” collider, if you are switch to “seam fix” else stay on player regular.

The “seam fix” layer is a simplified collider without the seam problem, so this script essentially makes it so you only collide with the giant collider if your on top of the bad seam collider, so it allows you to fall through the giant collider otherwise.