I have a procedurally-generated mesh that I am generating to use as a terrain. It looks something like this (from above, and it changes slightly every time):
It also looks fine when I view from the z-axis side.
The issue is that when I view it facing the x-axis, it has a black part kind of going through it.
I wouldn't really care about that, but when the player goes into the valley, it seems as if they fall under the black part. They can only see the ground and above them it is all black.
The mesh does have a mesh collider attached, and so the player doesn't fall the way through the mesh - just the "black line". The height of the mesh (on the y-axis) is generated using perlin noise that I multiply by 800 (to increase the waviness), and that is set when I set the vertices. I suspect that this issue has to do with the normals or the uvs not adjusting to the y-axis, but I've messed around with it a lot and nothing seems to help. I currently generate the normals with RecalculateNormals() after I generate the vertices, triangles, and uvs, and calculate the uvs in a for-loop where I take each vertex's x and z axis and divide it by the number of vertices on that axis time the distance between them (to make it between 0 and 1).