# How remove block mesh gap

I’m creating a minecraft based world, but i came across a problem.

When I generate the world, it becomes like the image with this little gap between blocks.

How i remove it?

![alt text][1]

I’m creating each quad individually and then combining it in a single chunk.

This is the code used to combine:

``````private void CombineQuads()
{
var meshFilters = Object.GetComponentsInChildren<MeshFilter>();
var combine = new CombineInstance[meshFilters.Length];

for (int i = 0; i < meshFilters.Length; i++)
{
combine_.mesh = meshFilters*.sharedMesh;*_
``````

combine_.transform = meshFilters*.transform.localToWorldMatrix;
}*_

* mf.mesh = new Mesh();*

* mf.mesh.CombineMeshes(combine);*

* renderer.material = TextureAtlas;*

* foreach (Transform quad in Object.transform)*
* {*
* }*
}
And this what i use to create each single quad:
{
* var mesh = new Mesh*
* {*
* name = side.ToString() + “QuadMesh”,*
* };*

* var p0 = new Vector3(-0.5f, -0.5f, 0.5f);*
* var p1 = new Vector3(0.5f, -0.5f, 0.5f);*
* var p2 = new Vector3(0.5f, -0.5f, -0.5f);*
* var p3 = new Vector3(-0.5f, -0.5f, -0.5f);*
* var p4 = new Vector3(-0.5f, 0.5f, 0.5f);*
* var p5 = new Vector3(0.5f, 0.5f, 0.5f);*
* var p6 = new Vector3(0.5f, 0.5f, -0.5f);*
* var p7 = new Vector3(-0.5f, 0.5f, -0.5f);*

* switch (side)*
* {*
* case CubeSide.Bottom:*
* mesh.vertices = new Vector3[] { p0, p1, p2, p3 };*
* mesh.normals = new Vector3[] {Vector3.down, Vector3.down,*
* Vector3.down, Vector3.down};*
* break;*
* case CubeSide.Top:*
* mesh.vertices = new Vector3[] { p7, p6, p5, p4 };*
* mesh.normals = new Vector3[] {Vector3.up, Vector3.up,*
* Vector3.up, Vector3.up};*
* break;*
* case CubeSide.Left:*
* mesh.vertices = new Vector3[] { p7, p4, p0, p3 };*
* mesh.normals = new Vector3[] {Vector3.left, Vector3.left,*
* Vector3.left, Vector3.left};*
* break;*
* case CubeSide.Right:*
* mesh.vertices = new Vector3[] { p5, p6, p2, p1 };*
* mesh.normals = new Vector3[] {Vector3.right, Vector3.right,*
* Vector3.right, Vector3.right};*
* break;*
* case CubeSide.Front:*
* mesh.vertices = new Vector3[] { p4, p5, p1, p0 };*
* mesh.normals = new Vector3[] {Vector3.forward, Vector3.forward,*
* Vector3.forward, Vector3.forward};*
* break;*
* case CubeSide.Back:*
* mesh.vertices = new Vector3[] { p6, p7, p3, p2 };*
* mesh.normals = new Vector3[] {Vector3.back, Vector3.back,*
* Vector3.back, Vector3.back};*
* break;*
* }*

* mesh.uv = Block.UVs.TryGetValue(side, CubeSide.Front).ToArray();*
* mesh.triangles = new int[] { 3, 1, 0, 3, 2, 1 };*

* mesh.RecalculateBounds();*