Z order and Y order confusing

Hi, I just got into g develop and watch some guides. I am stuck on this z-order and y order thing. My character appears behind the tree but when I move the tree up a bit, my character just run over it. It the same tree sprite.




The z-order is the order in which objects are drawn on the screen, from lowest first to highest last. The higher z orders appear in front of objects with a lower z order because they are drawn later and therefore over the top of lower z-order objects.

The Y position that you are using increases down the screen (the reverse of a standard Y axis). So an object with it’s origin lower down the screen will have a higher Y position value.

This higher Y position value mean a higher z-order value, which is why the character id drawn on top of the tree.

To fix this, use the Y-Sort extension and apply it to every affected object.

Thanks for the help!

The z order is really useful for if you want a background or a foreground image adds a lot more depth to a game.

The way I always sort out my Y and X position is to drag the object to where I want it to appear the check the X and Y then I know exactly where It will appear in game.