Search code examples
unity-game-enginegame-physicscollider

box colliders next to each other bug


I work on a game in which you can build your own level and play it. You can create a cube, with a box collider, and move it where you wants. You can also change its color. But when you put two cube next to the other, the character will detect a collision on Z axis. As my character collider is a capsule, it make my character jump. If I put a box collider instead of capsule, my character is stopped.

Here is a explanatory video: https://youtu.be/xuqs1zcdDlk

I tried to overlap both colliders, but problem is still here. Colliders have exactly the same height. How should I solve this??


Solution

  • Go to Edit > Project Settings > Physics, and try your game changing the Default Contact Offset value untill 0.

    Good luck for your game, can't wait to play it !