tilemap chunks causing sorting issues

Hi, we are using multiple tilemaps and have a layer that supports the player walking behind or in-front through transparency sort mode set to y=1.
This has worked very well previously but apparently the reason it worked was just a coincidence!
The tilemap is set to chunk-mode and this worked really well even if a e.g. tree is build out of more than one tile
6152818--672250--upload_2020-7-31_0-38-10.png
6152818--672256--upload_2020-7-31_0-39-0.png
However, the exact same tilemap acts completely different with sorting depending on the player’s y-position apparently
6152818--672259--upload_2020-7-31_0-39-53.png
and yes, this is the exact same tilemap

I did a sanity check in an empty map and tested with a much larger sprite - a house:
Here you can see that the sorting does not work at all
6152818--672262--upload_2020-7-31_0-41-1.png
BUT in the same level on a different position on the tilemap this works completely fine???
6152818--672265--upload_2020-7-31_0-41-49.png

My setup:

  • transparency sort mode to y=1 (2D renderer)
  • latest Unity 2019.4 LTS
  • one spritesheet

What I tried as well:

  • creating a SpriteAtlas and test in playmode
  • testing in URP renderer
  • setting all tiles and the player sprite to “pivot” mode

Switching the tilemap’s mode to “individual” does not work, each tile of that house gets messed up because the player is larger than one tile

So my conclusion(?) so far is that there must be some automated chunking going on that is messing up the render-order?
We only realized this circumstance today and after editing our levels the chunking seems to have broken our well-working previous levels.
Can someone please let me know if there is anything else I could try?

Chunking is best used when you know that everything on the tilemap is consistently in front or behind other objects. When you have a character who you want to render in front or behind depending on y-position, you should gravitate away from chunked tilemaps. The solution is to use Individual mode plus having tall sprites, like trees, be composed of single sprites. For these sprites, you want a well-placed pivot point so that they will sort at the correct point relative to the character.

More complex cases like where you want two sprites for a tree, one for the trunk and another for the canopy, can still be done; you just need to make sure the pivot point is correctly placed for both.

I see, thank you very much. We have been experimenting with a 3D character (having objects be placed along y and z axis!) so we need to cut all static/move behind objects from the tilemaps anyway at some point in the future so I guess your suggested solution is the way to go for us.