Greetings I have some issue with the Graphics.DrawMesh function I use it to draw a selection grid.
The problem is I only can see it inside the editor window when using a transparent shader.
Left is editor view and right is the game view.
Tags { "Qeue" = "Transparent" "RenderType" = "Transparent" }
LOD 100
ZWrite OFF
Blend SrcAlpha OneMinusSrcAlpha
With this settings its only visible inside the editor.
Using this settings works in editor and game view.
Tags { "RenderType" = "Opaque" }
LOD 100
The code i use when calling Graphics.DrawMesh
Graphics.DrawMesh(topMesh, renderPosition, Quaternion.identity, materialClean, drawLayer);
if (IsInsideBounds(x, z + 1, currentMap.GetLength(0), currentMap.GetLength(1)) && currentMap[x, z + 1] != 0 || z + 1 == endZ)
Graphics.DrawMesh(frontMesh, renderPosition, Quaternion.identity, materialClean, drawLayer);
if (IsInsideBounds(x + 1, z, currentMap.GetLength(0), currentMap.GetLength(1)) && currentMap[x + 1, z] != 0 || x + 1 == endX)
Graphics.DrawMesh(rightMesh, renderPosition, Quaternion.identity, materialClean, drawLayer);
if (IsInsideBounds(x, z - 1, currentMap.GetLength(0), currentMap.GetLength(1)) && currentMap[x, z - 1] != 0 || z == startZ)
Graphics.DrawMesh(backMesh, renderPosition, Quaternion.identity, materialClean, drawLayer);
if (IsInsideBounds(x - 1, z, currentMap.GetLength(0), currentMap.GetLength(1)) && currentMap[x - 1, z] != 0 || x == startX)
Graphics.DrawMesh(leftMesh, renderPosition, Quaternion.identity, materialClean, drawLayer);
continue;
For render layers i tryed setting it to 0 and 1.