Allowing you to be behind and infront of an object


I can have the player be ONLY Behind the object OR ONLY Infront of the object but never both. Its all the weird Z layer stuff. I want the player to be able to be infront of the object when infront of it, but also allow the player to be behind it when behind the object.
I have no clue how this would work but yeah, if this is possible (prolly is, im just dumb sometimes) i need help making it work!

Try to use YSort extension.

1 Like

So how does this work? do i put the behavior on the Player or the Object? Also is there a certain Z value i need the objects or players to have?

Bottom line
It sets Z order to your Y position
So you give it to both player and all objects that should be affected by it
Where for object that should be straight below player no matter what like for example grass or like road or water
You would NOT give it that behavior and set its Z order to something like -999999
OR going simple make new layer and move it below your player layer and put such objects there

Thank you so much. I got it to work now!