new Sprite wrong Z order

Create two sprites - one over the other. You will notice that in the editor the second sprite is on top. The first one is on the bottom. Visualy the second sprite is covering the first one.

However if you play test the game- it is the other way around. The first created sprite covers the second one. Leading to confusion.

The reason for that is that they both have the same Z order number (in their properties). If you create a new sprite - in the editor it is above the one you created before. So It should automatically assign it a higher Z order as well. The editor always assigns 1 to the z order of new objects. Does that sound like a bug?

It’s not a bug : having two objects with the same z-order does not guarantee their stacking order.

then a feature request:

assign a value to Z order that corresponds to what you actually see in the editor .

Imagine having a lot of objects in a scene. This Z order inconsistency between editor and output can become a huge hindrance

If you want to have a specific z-order, just assign a z-order to your object. Even if the editor would have exactly the same behavior than the game, you can have a blinking between objects with same z-order in-game.

Perhaps I should word my request differently :smiley:


Can we make Gamedevelop guess a Z-order value to assign to a newly created object- when it creates it. How does it guess?
I checks the Highest z order in all existing objects on the layer and it assigns that +1 to the new object.

My request is not to have to assign z order manually to every single object you create or clone. It is not to limit the ability to assign the same z order to two objects.

Otherwise the initial impression of everyone trying the engine is- well is this a bug?

1 Like