If you're using SpriteRenderer
s for the cards, you need to use settings such as Sorting Layer
and Order in Layer
rather than the Z position in the transform.
The higher the number, the closer the GameObject looks to the Camera. (docs)
More info: https://discussions.unity.com/t/how-to-set-sprite-rendering-order-for-a-card-game/937796
The default 3D Renderers draw stuff according to Z depth - distance from camera.
Sprites draw according to Sorting Layer and Sorting Depth (properties of the Sprite Renderer)
There's also this if you want to get more sophisticated: Unity Manual - 2D Renderer Sorting