Isometric z-order

Hello,

Does anyone have a solution for using z-order in isometric view, like in the screenshot below?

isometric-z-order

The cars are passing each other and at some point the z-order point of the car that’s most forward will be lower than the second car, which will put that car in front of the second car.

This happens mainly with long objects that are very close to each other.

Any way to make this work?

You can make it so if one car is below another, it changes the ZOrder to a higher number than the car it’s above. I think that would work.

Isometric z-order in a 2D enviroment is hard, If I were making a isometric game I would make it in 3D, which would handle it way better.

1 Like

@ValenCreates, thanks, but I’m already doing that and that is part of the issue - the car on the left is lower than the car on the right and that’s why it’s overlapping it.

@Reborn, thanks, but this is my first game development attempt, and I think 3D might be too much for a first try :sweat_smile:

Can you show me what you have? I made this example here.


Edit: Sorry, I didn’t test it when I sent this message, but don’t worry, I’ll still help out, I don’t think this works.

Are you using separate objects for each of the cars, or are they the same sprite?

It’s the same sprite for each car, and right now I’m only changing the z-order to a Y point that’s at the bottom of each sprite:

z-order

Might I recommend changing the ZOrder based on the Y of it as a variable? For example, have an event saying set variable “Y” to Car.Y(), and other events that say: if Car.Y < Car.Y (These are variables not Y values) change ZOrder to Car.ZOrder+1. That might work.

Thank you, I’ll give it a try and let you know if it worked :slightly_smiling_face: