Search Unity

Isometric Z-as-Y tilemap Sort Order issue

Discussion in '2D' started by Aoret, Jan 18, 2020.

  1. Aoret

    Aoret

    Joined:
    Jun 26, 2019
    Posts:
    1
    I'm struggling with isometric Z-as-Y tilemap sort order in one specific case. I'm am attempting to paint two layers of tiles into my tilemap. When I add a tile that I would expect to show "below" / "behind" my upper level, they instead partially obscure the tiles that are above them. The visual discrepancy can be seen pictured on the right side of this image:

    problematicTile.png

    The two levels are currently painted at Z=0 and Z=2. I have sort mode set to Individual, sort order set to Top Right, and Transparency Sort Axis set to X=0, Y=1, Z=0. I also double checked to make sure this isn't an optical illusion by switching between Isometric and Isometric Z-as-Y just to verify the tiles genuinely are beside on another in a contiguous grid.

    Is there something I'm missing here? My understanding was that by using Z-as-Y, I'd be able to leverage a single tilemap to paint tiles at multiple heights, but this leads me to believe that Z-as-Y isn't quite enough to do the job
     
  2. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    The Transparency Sort Axis needs to have a Z value set to be able to sort Tiles of a different height (-0.26 is suggested here).

    The issue here is that without a Z value set in the Transparency Sort Axis, the Tile in the lower level with the higher cell Y value is likely given an equal (or better) sorting weight compared to the Tile in the higher level but with a lower cell Y value. When they are equal, the sorting order between these Tiles is not controllable by you as the user (see Tiebreaker). Having a Z value set helps to weight the Tiles better in the higher level to give you the right rendering order.

    An example project is available here if you want to check it out sorting with the Isometric Z-as-Y grid.