Mesh Creation Problem

I want to add thickness to those meshes. I create separete triangles and I want to attach them so user can see the mesh. Because it is 2D it must has a thickness. My code is:

int y = 0;

	for (; y <(((pointList.Count-1))); y++)
	{
		indices[y*12] = 2*y;
		indices[y*12+1] = 2*y+2;
		indices[y*12+2] = 2*y+1;
		
		indices[y*12+3] = 2*y+1;
		indices[y*12+4] = 2*y+2;
		indices[y*12+5] = 2*y+3;
		
		indices[y*12+6] = 2*y+pointList.Count*2;
		indices[y*12+7] = 2*y+1+pointList.Count*2;
		indices[y*12+8] = 2*y+2+pointList.Count*2;
		
		indices[y*12+9] = 2*y+1+pointList.Count*2;
		indices[y*12+10] = 2*y+3+pointList.Count*2;
		indices[y*12+11] = 2*y+2+pointList.Count*2;
		
		indices[y*12+12] = 2*y+pointList.Count*2;
		indices[y*12+13] = 2*y+2+pointList.Count*2;
		indices[y*12+14] = 2*y;
		
		indices[y*12+15] = 2*y+2+pointList.Count*2;
		indices[y*12+16] = 2*y;
		indices[y*12+17] = 2*y+2;
		
		
		
	}

But it didint work for me. Thickness does not appear. I hope you can understand whay I try to say.

1 Answer

1

I know I had some surprises with Mesh creations, due to when I affected the mesh to the MeshFilter. If I remember correctly, it have to be done before filling the arrays.