Search Unity

Tilemap Collider 2D Works on one Tile but not Another

Discussion in '2D' started by RetroboltGames, May 3, 2019.

  1. RetroboltGames

    RetroboltGames

    Joined:
    Oct 26, 2018
    Posts:
    11
    I have a tilemap that has 2 tiles, when Tilemap Collider 2D is applied, it only works on one of the two tiles.
    Thanks
     
  2. RetroboltGames

    RetroboltGames

    Joined:
    Oct 26, 2018
    Posts:
    11
    Also the tile is transparent.
     
  3. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    The collider shape used by TilemapCollider2D depends on the Collider Type of the Tile asset (https://docs.unity3d.com/Manual/Tilemap-TileAsset.html). If you select the Tile Asset, you can see its Collider Type.

    If the Collider Type is Sprite, the Physics Shape of the Sprite of the Tile will be used, which if not set, will be generated from the Sprite's outline. If it is fully transparent, then there will be no Physics Shape for that Tile.
     
    RetroboltGames likes this.