Search Unity

Bug Composite Collider 2D Inconsistent results

Discussion in 'Physics' started by DanielThomas, Apr 6, 2021.

  1. DanielThomas

    DanielThomas

    Joined:
    Mar 30, 2013
    Posts:
    110
    (Tried on Unity 2020.1, 2020.2, 2020.3)
    I'm getting an inconsistent result with Composite Collider 2D that uses Offset distance to close gaps between colliders.

    Step-by-Step:

    1. I have an game object parent with two of 2D box colliders, but they have a little gap between them.

    2. I add an 2D composite collider, set it to geometry typer: polygon, and increase the Offset distance to where the colliders connect in straight lines (forming one big box with 4 rounded edges).

    3. If I now for example: delete the two current box colliders and "undo" them back, the composite collider isn't connecting with straight lines anymore, but have some dips/rounded edges where the box collider gap is.

    4. If I increase the Offset distance to where it connects with a straight line again and redo the step above (remove and undo back the colliders) it gives the same problem. I can keep doing this and the offset distance keeps increasing.

    ---

    Is this a bug or am I using the offset distance property incorrectly? It's almost like it's being additive for every time it get changed. Removing the composite collider and re-add a new one fixes the increasing offset distance and it's back to first step in my step-by-step above.
     

    Attached Files:

    Last edited: Apr 6, 2021
  2. DanielThomas

    DanielThomas

    Joined:
    Mar 30, 2013
    Posts:
    110
  3. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,474
    2D Physics is currently down to zero bug reports. If you suspect a bug here and can reproduce it easily in a simple project then I would ask that you kindly submit a bug report with it attached. If you also post the case number here I can take a look too.
     
  4. DanielThomas

    DanielThomas

    Joined:
    Mar 30, 2013
    Posts:
    110
    Done: (Case 1328999) Composite Collider 2D Inconsistent results
     
  5. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,474
    Sorry I didn't get back to you here; wish the forums had a reminder feature.

    Anyway, I wanted to mention that the above case is being looked at.
     
  6. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,474
    We've have figured out the issue. One of my colleagues will be fixing it. Soon a QA will accept your bug report and you'll get a public link so you can monitor the progress of the fix landing.
     
    DanielThomas likes this.
  7. DanielThomas

    DanielThomas

    Joined:
    Mar 30, 2013
    Posts:
    110
    Thank you, much appreciated!
     
    MelvMay likes this.