This is my first try making a "proper" game in Unity. I'm using the latest version (2019.2.2 at the time of writing) and I'm writing with C#. This is a project I'm doing for my studies, together with another person (he makes tiles, sound, music and I'm at charge of the programming).
We are making a 2D Roguelike RPG using the Unity tilemap feature.
My algorithm to generate dungeons works really well, but only used one ground tile and one wall tile. We found that to be very boring and changed it.
Now comes the problem. If I let the algorithm pick between fewer than 3 tiles, everything works fine.
If I let the algorithm pick from more than 2 tiles, something strange happens and the some tiles don't overlap properly.
I hope somebody can help me understand why this happens.
Here the important settings of camera and tilemap:
One weird think I have been able to find out: The tiles that don't overlap will change if I change the position of the camera.
As a gif: