Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

Bug Triangle Collider Sections Can Cause "Bumps" in Movement

Discussion in '2D Experimental Preview' started by Xepherys, Jun 22, 2016.

  1. Xepherys

    Xepherys

    Joined:
    Sep 9, 2012
    Posts:
    200
    Best shown in this video using preview assets. Where the collider creates a triangle, the point of the triangle causes a catch area for movement by the sprite.

     
  2. Johaness_Reuben

    Johaness_Reuben

    Unity Technologies

    Joined:
    Jan 27, 2016
    Posts:
    253
    The current collider is just a temporary, to have something to play with. TilemapCollider2D didn't make it for this preview and will be in the next one.
     
  3. Xepherys

    Xepherys

    Joined:
    Sep 9, 2012
    Posts:
    200
    I had seen that, though I am curious why the collider is exhibiting that behavior. So far as I can tell, it's smooth down to the pixel, but the capsule collider on the player doesn't seem to believe that.
     
  4. Johaness_Reuben

    Johaness_Reuben

    Unity Technologies

    Joined:
    Jan 27, 2016
    Posts:
    253
    Yeah. There is bug with the CapsuleCollider2D. It doesn't follow the rounded edge and treats it like a box. The CapsuleCollider2D currently works with other CapsuleCollider2Ds'.
    Fix will be in the next release.
     
    Xepherys likes this.
  5. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    5,563
    This has nothing to do with the CapsuleCollider2D. The problem is that multiple colliders don't act as a single collider surface even if you overlap/align them i.e. they still contain separate edges to the physics system. Box2D which is the 2D engine (but the same goes for PhysX 3D physics) allows tiny overlaps of colliders for numerical stability and it solves each collider individually. This means that it's possible to contact edges/vertex when you've overlapped/aligned multiple colliders together.

    The only way to not have this is to use a single, continuous surface which is what the EdgeCollider2D provides. The new TileMapCollider2D will still produce a collider shape for each individual tile so won't solve this however the new CompositeCollider2D can merge together multiple collider shapes into a single continuous edge. The TileMapCollider2D, BoxCollider2D & PolygonCollider2D can all be composited.
     
    Xepherys likes this.
unityunity