Change "Order in Layer" of individual Tiles by Script

Hello,
I’m currently using a script which is sorting certain gameobjects, within a sorting layer, by their y position. Now I want to do the same with all tiles, within a layer, of my tilemap. But I’m kind off lost by figuring out, how to get acess to the sorting order, of each tile. Can somebody help me, by telling me how to change the sorting order of tiles by scripts?

This would be useful to me as well.

Has anyone found a solution to this? I know how to write custom tiles but you don’t seem to have access to a spriterenderer, only a sprite. I desperately need a solution here.

I think that the tiles all render as a single mesh making it not possible at the moment.

I worked around this by making multiple tilemaps with different sorting layers and put/move the tiles onto the appropriate tilemaps.

1 Like

Incredibly simple, incredibly genius. Thank you.