2D sprite ordering problem

I am making a roguelike game. and i’m concerned about the order layer of the bushes.

My goal is below
120627-question11.png

I have sorting layers with names Soil(priority: 9) and Bush(priority:10) and Character(priority:11). So it looks like picture(1).
The other thing I want to do is make it look like pictures(2~3).

But what I’ve tried is it looks like pictures(4~5).

120628-question22.png

If I joined Bush’s collision, I had the character’s layer turn into Soil, and if I left the character’s collision, I had the character’s sorting layer become a character.

To solve this, the character’s sorting layer was left and only touched Bush’s sorting layer, but it got tangled.

Do you know the reference or answer to solve these problems?

thanks you :slight_smile:

priplo
HearherMan_f
@ZRL

You shouldn’t need to alter the sorting layer. All you need to do is use the Sorting Order variable. Each row of bushes should have its own sorting order value. For example, you could give the front row of bushes sorting layer 0, the second row -2, and the third row -4.

Then, you should manipulate the player’s sprite sorting order to be in front of whichever row you want it to be. For example, sorting order 1 would put it in front of all of the bushes, sorting order -1 would put it between the first and second rows, sorting order -3 would put it between the second and third rows, and sorting order -5 would put it behind all the rows.