Procedural Mesh breaking triplanar shader

Hi all,
Having some issues with my procedural mesh causing my triplanar shader to make the left/right side of my cube to just show up brown. As shown in the image below it works perfectly on a default unity cube but not my procedural one. The front, back and top face work perfect. The yellow lines are the normals and they are all pointing in the correct direction… im not sure what else could be causing this?
[177623-test.png*_|177623]

The reason I’m doing it by faces is because my plan is to only generate the faces ill need.

	private void CreateVertices()
	{
		int gridSize = Mathf.RoundToInt((size - 1) / width);
		int halfSize = gridSize / 2;
		vertices = new Vector3[size * size * sides];
		normals = new Vector3[vertices.Length];
		int i = 0;

        //top
        Vector3 XZPlane = Vector3.zero - Vector3.right * halfSize - Vector3.forward * halfSize;
        for (int x = 0; x < size; x++)
        {
            for (int y = 0; y < size; y++)
            {
                vertices *= XZPlane + new Vector3(x, halfSize, y);*

_ normals = Vector3.up;_
* i++;*
}
}

Vector3 XYPlane = Vector3.zero - Vector3.right * halfSize - Vector3.up * halfSize;

* //front*
* for (int x = 0; x < size; x++)*
* {*
* for (int y = 0; y < size; y++)*
* {*
_ vertices = XYPlane + new Vector3(x, y, halfSize);
normals = Vector3.forward;
* i++;
}
}*_

* //back*
* for (int x = 0; x < size; x++)*
* {*
* for (int y = 0; y < size; y++)*
* {*
_ vertices = XYPlane + new Vector3(x, y, -halfSize);
normals = -Vector3.forward;
* i++;
}
}*_

_ Vector3 YZPlane = Vector3.zero - Vector3.forward * halfSize - Vector3.up * halfSize;_

* //right*
* for (int x = 0; x < size; x++)*
* {*
* for (int y = 0; y < size; y++)*
* {*
_ vertices = YZPlane + new Vector3(halfSize, x, y);
//normals = Vector3.up;
* i++;
}
}*_

* //left*
* for (int x = 0; x < size; x++)*
* {*
* for (int y = 0; y < size; y++)*
* {*
_ vertices = YZPlane + new Vector3(-halfSize, x, y);
//normals = -Vector3.right;
* i++;
}
}*_

* }*

* private void CreateTriangles()*
* {*
_ int quads = (size - 1) * (size - 1) * 2 * sides;
triangles = new int[quads * 6];_

* int i = 0;*
* int v = 0;*

* for (int s = 0; s < sides; s++, v+= size)*
* {*
* for (int y = 0; y < size - 1; y++, v++)*
* {*
* for (int x = 0; x < size - 1; x++, v++)*
* {*
* if (s%2 == 0)*
* i = SetQuadInverse(triangles, i, v, v + 1, v + size, v + size + 1);*
* else*
* i = SetQuad(triangles, i, v, v + 1, v + size, v + size + 1);*
* }*
* }*
* }*
* }*

* private static int SetQuad(int [] triangles, int i, int v00, int v10, int v01, int v11)*
* {*
_ triangles = v00;
* triangles[i + 1] = triangles[i + 4] = v01;
triangles[i + 2] = triangles[i + 3] = v10;
triangles[i + 5] = v11;
return i + 6;
}*_

* private static int SetQuadInverse(int[] triangles, int i, int v00, int v10, int v01, int v11)*
* {*
_ triangles = v00;
* triangles[i + 1] = triangles[i + 4] = v10;
triangles[i + 2] = triangles[i + 3] = v01;
triangles[i + 5] = v11;
return i + 6;
}
[177624-test2.png*
|177624]*

EDIT: Solved. Issue ended up being inside the triplanar shading I was handing normal mapping wrong.
*
*

Did you recalculated tangents?

You forgot to uncomment two lines. Quite important ones :T

//normals *= Vector3.up;*

//normals = -Vector3.right;