I’m trying to decorate my 2D world with 2D objects, and I want the player to be able to walk “around” the objects, so that the character can stand in front of the object, collide with it and walk behind it. I’ve achieved the effect in some way, but when you move the character down from the top part of the object, it clips on top of it. (See the pictures: )
The characters appears in the front of the object as she should:
The character can also go behind the object at the upper part of Y-axis…
…but when she walks down, she clips on the top!
I tried to look up multiple threads and a couple of videos on how to achieve this effect, and they all seemed to use a line of code. However, when I looked at the newest comments, they all said that you don’t need the code, since Unity already has a built-in way to do it (Graphics settings > Transparency sort mode), so maybe the tutorials were just outdated. Still, I’ve been trying to mess around with the order of sorting layers, pivot points and transparency sort mode settings, but nothing seems to help.
(Currently, I have both the house and the playable character in the same sorting layer, their pivot is set to bottom and transparency sort axis Y is 1)