Changing Z-Postions of created objects

Hi Guys :innocent:,

there is a problem in my game. I build a City Builder like Game in the Style of “Dorfromantik”, where the Player can create different platforms and stuff like this. The platforms are build in a hexagonal grid, which is working pretty fine. But the problem is the following: the graphics are bigger than a platform (which is intended), so when you place an Object “behind” another it appears in front of an old object. Is there a way to change Z-Positions for objects that are created through an event?

Here are some pics, so you know what I mean:

Hopefully there is a solution for this problem.

your Badger Boy :badger:

You could do it based on Y position, so the higher up the screen the lower the z order.

1 Like

If you search Z it will show z order in the actions

and you can use that to change the z order after creation

but are you running any z ordering events or behavior in your logic? Like @spintron15 said you can do it based on the Y position or use the YSort behavior. That works best if you can change the origin point of your objects but if you prefer not to because you use the origin point to stack images correctly you can edit the behavior to set the Z order to the bounding box bottom of your objects instead or something.

1 Like

Thanks a lot, I finally fixed it. The YSort was the simple Solution! :slight_smile:

1 Like