question about sorting layer in a topdown 2D,Hi!

I’m making a top down 2D game, the problem is that if I put the character on a lower sorting layer than an obstacle (i.e. tree) when he walks in front of the tree, he will be in front of it, but if he walks behind the tree, he will still appear on top of it. how do I solve this? ,

The typical way to solve this is to adjust the sorting layers based on the z position, so that as your character moves around, their sort layer will be changing.

Hello, you should follow these steps:

Project settings → Graphics → Transparency Sort Mode = Custom Mode

And set to X: 0, Y: 1, Z: 0

The player and the tree should be in the same sorting layer.

If you are using tilemap, you should also set “Tilemap Mode: Individual”.

Also detailed video: Designing With 2D Game Tools - Sorting Groups and Transparency Sort Axis [4/6] Live 2017/6/ 7 - YouTube