Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Triangle Collider Sections Can Cause "Bumps" in Movement

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

Thread Status:
Not open for further replies.
  1. Xepherys

    Xepherys

    Joined:
    Sep 9, 2012
    Posts:
    204
    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

    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:
    204
    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

    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:
    11,324
    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.
  6. Gigabitten_Gaming

    Gigabitten_Gaming

    Joined:
    Jul 10, 2017
    Posts:
    32
    Do other engines like UE5 or Godot have this problem? If so, how do they handle them? This seems like an extreme pain point to me, one that ought to have a better solution built into the engine itself.
     
  7. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,324
    Please create your own posts, don't necro old posts like this. There's a 2D forum, this thread is in an old experimental forum.

    This is Box2D, not "Unity". UE5 is 3D and uses PhysX, same as Unity which also has this. It's how physics engines work.

    So you're saying the dedicated component above is not a solution built into the engine nor is using EdgeCollider2D which also doesn't have this problem.
     
Thread Status:
Not open for further replies.