Camera shows objects in wrong order

In my project card objects are instantiated in front of the camera, so that each new card is a moved a bit to the right and a little bit higher than the previous one.

Everything works in theory and I can see the right results in the scene view (and by naming the objects with number I checked if everything is right). But inside the game, instead of stairs made of card objects I get a pyramid. I tried moving the camera left and right and I’ve noticed that the highest card is always the one with the camera directly above it. Long story short, I want my cards to look like in the scene view.

Also - I tried modifying the float that is used to determine the height of the card inside the scene but it doesn’t matter, the middle card is always on the top.

Picture related: alt text

I think that you are suffering from the problem of camera space Z. The card under the camera is closest to the point which represents the camera in the world. You will need to modify the z order of your objects more dramatically to ensure that this isn’t the case. check the Vector3 distance from the camera’s position to the card’s position.