Hello, we are currently working on a 2D Platformer. The Objects in the game are represented as textures on a plane with invisible bounding meshes as platforms.
We use the normal perspective camera instead of the orthographic one so we can have background objects at different z-coordinates to simulate parallax scrolling.
However there seems to be a problem with this method. In the inspector, in the game and also in the build game some objects are shown as being in front of other objects even though they are technically behind them.
Example:

The mushroom is actually 5 units behind the tree but still shown in front of it. If I move the character however:

If I’m above the mushroom it is shown correctly. Even if I place the mushroom about 20 units behind the tree it is still shown to be in front of the tree, it only gets smaller. This problem doesn’t exist in orthographic projection but we would loose the parallax scrolling if we were to use that. I don’t know what’s causing the problem or how to fix it. Anyone got an idea?