Hi! For my platformer game, I’m using the perspective camera instead of the orthographic for a variety of reasons (parallax effect, particle issues, etc.) and I’ve come across a problem.
Let’s say I have 2 objects: One in the front, and one in the back. If the player closes in to one of them, and then moves away from it, the objects sort of overlap differently. I don’t really know how to explain it, so here you go:
What it should look like at all times:
What it actually looks like from the other side (after the camera moves):
As you can see, the boulder that was in front went to the back, and the one in back went to the front. This does not happen in orthographic, but I can’t use an orthographic camera.
I haven’t really tried much, since I don’t really know what to try. But I can at least tell you that offsetting the Y axis doesn’t change anything.
I think the best way would be if you built a system for setting a “z-index” on the objects the that overrides how things are rendered. So that the ones with the greatest z-index are rendered on top of the lesser.
Well… I think they are. They are literally just sprites placed next to each other with different Y-values. And what do you mean by “do they turn”? I’m guessing they do, since that’s basic perspective camera behavior. I’m clearly not well-versed in this though, so forgive me xP