# How do I fix the bug where my Rigidbody gets stuck on the edge of two Colliders?

The boxes are standing right next to each other, but somehow, the player manages to collide with the ghost edge. I use AddForce to control the player with a Box Collider, though I also tried using a Mesh Collider, and I tried setting the player's collision to continuous. This also happens in 2D.

I've seen other people's posts about this bug, but I couldn't really understand how to fix it. How do I fix this?

• Is the box moving exactly parallel to the cubes' faces or does it collide with the first box at an angle and then slide along its face? – Jon Mar 5 '16 at 18:27
• exactly parallel – Mateusz Sowiński Mar 5 '16 at 18:40
• – DMGregory Jul 31 '17 at 3:27

I think I had a similar issue in 2D. Try replacing your Box Collider with a reasonably sized sphere or capsule.

In 2D, I ended up using a Circle Collider with a smaller Box Collider. The Circle Collider made it so that my player didn't get hung up on the floor and walls that were composed of discrete boxes (with associated Box Xolliders). I added the smaller Box Collider to the player, because as a 2D platformer, I did not want my player to slide off the edge of obstacles.

• Er. My mistake. I didn't realize this question was that old. Hopefully the answer will still be helpful for someone else. – derstander Dec 10 '16 at 2:15
• Question age doesn't matter :) As you say, maybe it will help someone! – Alexandre Vaillancourt Dec 10 '16 at 2:37

Try changing the material of your box colliders. Also, I found a similar thread in Unity forums. That's about 2D, but the problem seems to be the same.

• No it's not that, I tried everything, no static friction, no friction at all ect.. – Mateusz Sowiński Jan 25 '16 at 18:40