How do I make my player sort properly on my grid tile walls?

I have these wall tiles on my project, and I am trying to figure out how to properly render the player and other objects in front and behind them depending on where they are.


I thought it would make sense for the player to be able to go behind the top walls, so I removed collision for the top part of it:


The problem is I’m not sure how to render objects in front of walls when under them and behind when they are hiding behind the top parts.
changing the transparency sort axis alone doesn’t seem to help:
compare.png



. Change ‘data-direction-horizontal’ to ‘data-direction-vertical’ for a vertical slider.

The player and the walls were on layer 1 when I was messing with the sort settings,

I was thinking maybe to change the player’s layer dynamically through code, but there’s instances where the player touches both the bottom and top parts of a wall. so changing the layer could not work on small spaces.

Only thing I can think of to solve this would be putting all the top wall tiles on a different grid : / which might mess everything up since I’m building the walls using a rule tile.

The sort point of the player should be at the bottom of the character, the same place its collider should be. You don’t want it in the center of the player.

yes I did make sure the player’s Sprite and GameObject pivot is at the bottom if this is what you’re refering to