Isometric Tilemap - Sprite Renderer

Hi, I have a problem with the Isometric Z As Y Tilemap.

I’m using grid-based movement. My character standing in the right place and the Sprite Sort Point is set to Pivot. Why is not hidden behind a wall in this situation?

My settings:

Not too used with isometric Z As Y settings and tho player movement yet, have you already tried playing around with the “Orientation” setting of the Tilemap and the “Sort Order” of the Sprite Renderer ?

It’s complicated because the character must have a sort order bigger than the floor on which it stands (or different sorting layer), and at the same time, to be hidden behind something, this thing must be at the same order in layer as the character. So it’s hard to make more height levels than one.

I’ve tried different combinations with a few tilemaps (terrain, floor, walls), sorting layer, order in layer, pivot position, transform position Z, but I didn’t get a good result in every aspect. When I improve one thing with sorting, another will appear that doesn’t work as it should.

The hard way:
you need to change the depth live while the character is walking around. This is what I am doing in my 2D game, where the character should hide smoothly behind a tree or pillar or whatever depth-simulating object, while the character is at the same time able to walk in front of the object smoothly.
Check out my guidline from the forums pinned threads “Sharing means caring: Things I wish I knew before starting with Tilemaps and 2D (2,5D)”
https://discussions.unity.com/t/764132
You will find bulletpoint 6.) usefull for your issue.

The easy way:
change the sprite and have some custom tiles, meaning you will paint the whole pillar at once, so the pivot will be lower than the pivot of the player and by making use of the draw order it will automatically appear in front or behind the pillat depending where he is on the Y axis.
So instead of placing 5 rocks over each other, create 1 rock-pillar-tile and paint in on the lowest position of the 5 rocks from before.
This would do the trick, but in long-term no good solution as you have to customize every situation.

So if there will be much of these situations in your project, then I strongly recommed the first approach.
If there are just a hand full of situations where you will need this hide-behind-show-in-front effect, then your would rather to the second approach.

KR,
blu3

I managed to achieve the intended effect using three tilemaps:
terrain - no changes,
floor - transform Z set to -0.5 and the same sorting layer as walls
walls - transform Z set to 0.5 and the same sorting layer as floor.

Now I need to hide the southern and eastern walls somehow while the character is in the building. Probably needs a Shader. Hiding the ceiling is finished now.

I will also try what you wrote. Thank you for your answer.

I’m working on something related to this project and I will probably release it in the Asset Store.