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 Not Lining Up With Particular Tiles on Tilemap

Discussion in '2D' started by Zegley, May 25, 2022.

  1. Zegley

    Zegley

    Joined:
    Oct 17, 2014
    Posts:
    26
    Hoping someone can point me in the right direction here at least.

    I have attached a reference picture below. I have particular small tiles on my tilemap that are not lining up correctly with the tilemap collider/composite collider. Am I doing something wrong here? Do these possibly need to be placed on a separate tilemap and sliced differently?
     

    Attached Files:

  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,761
    The TilemapCollider2D just represents what your original Sprite tiles are set to. If you're using "Sprite" as the collider type for those tiles then it'll use whatever you've set as that or, by the sounds of it, you've left it at the default which is just a rough guess at an outline.

    You can edit the "physics shape" for any Sprite in the Sprite Editor.
     
    Zegley likes this.
  3. Zegley

    Zegley

    Joined:
    Oct 17, 2014
    Posts:
    26

    This did the trick, easily. Thanks!
     
    MelvMay likes this.