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.

Tilemap Collider

Discussion in '2017.2 Beta' started by Rabagast, Sep 1, 2017.

  1. Rabagast

    Rabagast

    Joined:
    Jan 30, 2013
    Posts:
    78
    Hi!
    I just downloaded Unity 2017.2 Beta, because they finally added the tilemap editor.
    I hope in the final release that there will be possible to add a Tilemap Edge Collider instead of Box Collider.
    That's the best and only solution to avoid collisions between tiles. Of course you can add a circle collider to the character, but then there will be some other problems. :)
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,761
    What you're asking doesn't quite make sense. The TilemapCollider2D produces per-tile shapes which can be the shape of the tile, the sprite shape or custom edited by you in the shape editor (per tile) so it's not fixed at boxes.

    If you want to take all the individual shapes the TilemapCollider2D produces (and any other colliders) and blend them together then add a CompositeCollider2D. You can then set this to Outline (edges) or Polygon. Setting it as Outline means you get continuous edges.
     
    arc101 likes this.
  3. Rabagast

    Rabagast

    Joined:
    Jan 30, 2013
    Posts:
    78
    Hi!
    Thank you for the answer. I just made a movement left and right. Then I added a tilemapcollider 2D. On the player, I use a box collider. When I move the player, it gets stuck between tiles. Should I add a CompositeCollider2D on the tilemap or the player? And what does CompositeCollider2D Do? The player is still stuck between tiles. This has always been a problem with box colliders. Edge collider doesn't have this problem. Well, maybe I was wrong when I said box collider. A TilemapCollider2D as you say take the shape of the sprite, but the result will be the same. Stuck between tiles. How can I fix this with the TilemapCollider2D?
     
  4. Rabagast

    Rabagast

    Joined:
    Jan 30, 2013
    Posts:
    78
    I got it to work. I didn't know what the CompositeCollider2D actually does. Thank you! :)