My z order problem

Nothing really changed

The problem is I don’t know what your NewSprite5 is doing, where it should be etc. Same is with your house. Where is it, how it is related to the other objects etc.? The only thing I can recommend is to take a look at some of the example projects to get some idea how you could set things up. Here is the ysort example: GDevelop 5 and here a topdown rpg example GDevelop 5 Probably you know both of them but just look at the z-order of the background etc. The top-down example is also working with collision-objects.


here you go

I have sent you another snip

I still don’t know who the player is and what should happen with the house. Should your player walk around the house?

Here is what I would do: just set your background to a very low z-order (in the top-down example it is -10000!). Attach the y-sort behavior to your player, to the house and to everything else that should display depth. The z-position is based on the origin-point’s y-position of a sprite. If you want your player to have a depth-effect with the house you have to lower the origin-point of the house (how much depends on your preferences, you have to try).

Let’s say you moved the origin point of your house to the middle. Now your player can walk over the house and disappears behind it, if the player crosses with its origin-point the middle of the house. To prevent that you need to put collisions in your events. You could used the collision box of your sprite-objects (you need to adjust them to have the effect you want) or you use an invisible collider-sprite which you can place wherever your player should not move.

how to really control the ysort

There is not much to control and I already described how it works in the previous post.

The 0,0 position of your viewport is in the left upper corner. If you move up with your sprite its y-position will be a smaller number than that of a sprite which is lower on the screen. The y-position is measured on the origin point of your sprite, which is by default in the left upper corner of your sprite.
If you set the z-position to the y-position of the sprite - that’s what the y-sort extension does - then the upper sprite gets a smaller z-order value and the lower sprite a higher z-order value. Higher means it will overlap the lower sprite.

For adjusting the depth-effect (e.g. making a player walk behind a house), you just need to lower the origin point a bit and the value of the sprite’s y-position (and its z-position) is a higher value than before. To avoid that a player can walk across your house and is disappearing suddenly, you just can limit the movement with colliders.

Its all in the examples linked above and the most important way to figure something out is just trying things yourself.


Topboy is an npc, Dello’s sprite goes under topboy’s sprite which was not intended. When i did try to fix it, everything aside from the floor, if outside the scene window border, dello always goes under the sprite of an npc or just an impassible object, i don’t know what to do, please help

I need a bit of help here

Well, I suggested the whole time that you use the y-sort behavior. Of course you can set your z-order manually but then you have to try a bit to see what works. I cannot give you much more suggestions than that. Btw you don’t need the floor-expression. The z-order is expressed in integers anyway.