What I am trying to do:
Use an Isometric Tilemap, have my characters walk behind and infront of stuff
I followed this old thread to set it up: https://forum.unity.com/threads/isometric-tilemap-sorting-issues.554914/
But, I do not know how to correctly set up my characters to not “sink” into the tilemaps.
Some pictures to illustrate my problem, white box sprite “sinks” into tilemap:
Moving behind stuff works perfectly fine, just the lower bound is wrong
This is what the floor tile looks like in the tile palette, surface is aligned perfectly (or well enough, I guess) with the grid:
From the other direction, as soon as the center of my character passes the center of the barrel tile, the barrel starts being drawn infront of my character (on this picture the floor tilemap is set to a background sorting layer, thats why there is no sinking. The barrel is on a different tilemap, on the same sorting layer as the character, thus causing a problem)
What I think is the problem:
As soon as the “center” of my sprite passes the center of the tile, the tile will be drawn over my character.
How do I change this “center” of my character?
In case it’s relevant, the character is made out of Anima2D bones and meshes, but has a sorting group script attached. But I have the same problem with a simple 2D sprite as well.
Edit: Short gif to illustrate the current behaviour. As soon as the center of the white square goes above the center of the tile, the tile will be drawn infront of the square. I need to either move the center of the white square somehow, or the center of the tiles.