Search Unity

  1. We would like to hear your feedback about Unity and our products. Click here for more information.
    Dismiss Notice

Tile Map Composite Collider 2d not behaving as expected

Discussion in '2D Experimental Preview' started by CyanSlinky, Oct 16, 2017.

  1. CyanSlinky

    CyanSlinky

    Joined:
    Feb 27, 2014
    Posts:
    12
    I'm trying to use a tilemap collider 2d in conjunction with a composite collider 2d to have "walls" on the edges of the tiles but the composite collider doesn't seem to be merging them properly in some places and as a result i get walls where i don't want them.

    the red arrows indicate where it's generating walls where i don't want them.

    colliderwhy.png
     
  2. CyanSlinky

    CyanSlinky

    Joined:
    Feb 27, 2014
    Posts:
    12
    i did some tests and apparently it works fine with a normal tile.
    It breaks when using a terrain tile from the 2d extras, any way to fix it?

    Edit: i tried using the rule tile instead and it seems to break on the edges of rotated tiles?
     
    Last edited: Oct 17, 2017
  3. CyanSlinky

    CyanSlinky

    Joined:
    Feb 27, 2014
    Posts:
    12
    a year later and this is still broken, no idea how to fix it.
     
  4. thatscraigz

    thatscraigz

    Joined:
    Mar 27, 2015
    Posts:
    61
    Just ran into this :| pretty annoying. Do you know if it still happens when using a rule tile made from scratch? (versus duplicating the example one?)
     
  5. CyanSlinky

    CyanSlinky

    Joined:
    Feb 27, 2014
    Posts:
    12
    Never managed to fix this, and i haven't tried since the last time i posted. You could try making your own rule tile from scratch or try to figure out what's doing it in the existing one, i moved on to other projects since then but id appreciate it if you could share your solution if you figure it out!
     
  6. thatscraigz

    thatscraigz

    Joined:
    Mar 27, 2015
    Posts:
    61
    For sure - I'll tinker some more and post again if I happen to find the fix. Pretty annoying :confused:

    Thanks for the reply! :D
     
  7. GuyHC

    GuyHC

    Joined:
    May 8, 2019
    Posts:
    2
    Did anyone find a fix for this? Having exactly the same issue. Manual tiles are fine but rule tiles are causing all sorts of weird additional bits.
     
  8. thatscraigz

    thatscraigz

    Joined:
    Mar 27, 2015
    Posts:
    61
    I ended up moving on to other stuff :/ couldnt get it working properly ><
     
  9. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    249
    There is a new option in the CompositeCollider2D in Unity 2019.1.3f1, Offset Distance, along with the existing Vertex distance to help deal with the gaps.
     

    Attached Files:

    • CC.PNG
      CC.PNG
      File size:
      23.3 KB
      Views:
      60