Search Unity

Tilemap rendering order

Discussion in '2D' started by Karasikq, Mar 28, 2021.

  1. Karasikq

    Karasikq

    Joined:
    Jun 3, 2020
    Posts:
    4
    Can I change the sorting of the tilemap in the chunk mode so that the bottom tiles are always higher? This works with the same tile, but if you add other, the rendering order will change.
    Example:

    Same tiles(grass) render in right order, but sand renders overlay.
    Now I'm using multiple tiles with 6 tiles for each "block". I check
    neighboring grid cells and if one of these are empty I set necessary tile.
    Example:

    But it's very expensive to create 6 tiles for each block and check neighbor cells.
    P. S. Individual rendering mode doesn't work for me
     
  2. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,511
    If you're in chunk mode, and these tiles are all in the same tilemap, they need to share the same spritesheet / sprite atlas or else it can't render correctly. If they're not already, put them in the same Sprite Atlas https://docs.unity3d.com/Manual/class-SpriteAtlas.html

    When you want one type to always render above another type, you could put them in separate tilemaps and change the Order in Layer or Sorting Layer.

    You may also find you need to change the Tilemap's Sort Order property.
     
    Xiangting_Su and Karasikq like this.
  3. Karasikq

    Karasikq

    Joined:
    Jun 3, 2020
    Posts:
    4
    Lo-renzo, thanks, sprite atlas this is exactly what I needed!