Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

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:
    28
    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:
    28
    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:
    28
    a year later and this is still broken, no idea how to fix it.
     
  4. thatscraigz

    thatscraigz

    Joined:
    Mar 27, 2015
    Posts:
    100
    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:
    28
    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:
    100
    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:
    4
    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:
    100
    I ended up moving on to other stuff :/ couldnt get it working properly ><
     
  9. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    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:
      733
  10. sagivmis

    sagivmis

    Joined:
    Jul 10, 2021
    Posts:
    1
    If anyone encounters this thread- I don't think its supposed to fix this, but this probably shouldnt happen in the first place so i guess whatever works ^^
    I really dont know if it'll work for you but for me it worked to simply hover with a regular tile from the palette over the painted ones in the scene
    And yes, I laughed so hard when I found out this was the fix for it.