Search Unity

Seams in colliders.

Discussion in 'Physics' started by ookki, Oct 21, 2021.

  1. ookki

    ookki

    Joined:
    May 3, 2016
    Posts:
    8
    I have a scene where I spawn basically street pieces (basically planes) after each other the further I go. Each of them have a box collider to keep the rigidbody player on not falling through the ground. Now if my player with a capsule collider goes fast enough he will sometimes collide and jump at the seams where the road colliders meet each other. I thought I might fix it by making the players collider a box but then it just gets stuck in the seams.

    I tried to google about the issue and it seems that I'm not the only one but there weren't any good answers. I should be able to fix it in this project by just removing the individual colliders and make a huge one because of a looping nature of the game I know the position and length of the whole street at all times but surely if I continue programming there will be projects where I meet this problem again. I'm having a hard time believing that there isn't a general fix for this out there.

    I'd really like to use the rigidbody physics in my project and not try to code my own.
     
  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,510
    Use planes (flat mesh colliders) instead of box colliders. The character is colliding with the vertical plane of the boxes. Removing these vertical planes resolves the problem.
     
  3. KUNGERMOoN

    KUNGERMOoN

    Joined:
    Apr 29, 2020
    Posts:
    18
    Try decreasing the Default Contact Offset in Edit/Project Settings/Physics

    Changing it from 0.01 to 0.0001 worked for me

    Source
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,497