Player Not Going Behind and In Front of Tiles Correctly

I’ve just started learning how to make a 2D game with Unity and I’m facing an issue with the sorting order of my player as it moves behind and in front of tiles.

My hierarchy window is as follows:

  • Background
  • Layer 1 (Tilemap for Ground): Sorting Layer: Default, Order in Layer: -10
  • Layer 2 (Tilemap for Ground): Sorting Layer: Default, Order in Layer: -9
  • Layer 3 (Tilemap for Ground): Sorting Layer: Default, Order in Layer: -8
  • Other Collisions (Tilemap for Walls): Sorting Layer: Default, Order in Layer: -7, Tilemap Collider 2D, Rigidbody 2D (Static)
  • Object Collision (Tilemap for Objects): Sorting Layer: Default, Order in Layer: -7, Tilemap Collider 2D (used by Composite Collider 2D), Rigidbody 2D (Static)
  • Player: Sorting Layer: Default, Order in Layer: 0, Box Collider 2D, Rigidbody 2D.

I don’t know if I got the organization right but the player’s order doesn’t seem to update correctly as it moves. I tried making the order in layer for Other Collisions and Object Collision 0 to match the Player’s order in layer but that didn’t work. I’ve changed the transparency sort axis to (0, 1, 0) in Graphics Settings too. I also have some sprites as objects which work fine, but with tiles it doesn’t work no matter what I try.

Here’s a video of the game:

I added the bushes as sprites so they work fine but the rest don’t.

Btw I used custom physics shape for the tiles, and only the bottom tiles act like sprites. I set the collider type for others to none.

Could you please review my setup and provide any insights or suggestions on what might be wrong?

Thanks in advance