Starting off with some 2D in Unity. I am running 2019.4.12f1. I am following the "Let's Make Solitaire in Unity" by Megalomobile. I am dealing out the cards with the code:
IEnumerator SolitairDeal()
{
for (var i = 0; i < 7; i++)
{
var yoff = 0.0f;
var zoff = 0.03f;
foreach (var c in bottoms[i])
{
yield return new WaitForSeconds(0.1f);
GameObject newCard = Instantiate(cardPrefab, new Vector3(bottomPos[i].transform.position.x, bottomPos[i].transform.position.y - yoff, bottomPos[i].transform.position.z - zoff), Quaternion.identity, bottomPos[i].transform);
newCard.name = c;
newCard.GetComponent<Selectable>().faceUp = c == bottoms[i][bottoms[i].Count - 1];
yoff += 0.3f;
zoff += 0.03f;
}
}
}
When it renders in game mode I get this:

If I switch to Scene mode to inspect the z values, they are correct and everything is properly rendered:
I can increase the zoff value but as I do so, I am getting a good deal of parallax which I do not want. I have looked for creating a camera that eliminated parallax, but could not find one. I thought of using tags but managing that would get cumbersome depending on how many cards are in each stack.
Thank you in advance for any help.
EDIT: Thanks to the reference from @derHugo below I have found the fix. First, I changed the camera to Orthographic. Second I also had to change the camera's depth. Apparently if the depth is negative, it is still Perspective.