Debug.Log(y); and Debug.Log(i + “” + new Vector3(x, y, (i%(width + 1)))); both return y as 22 shown in the image, yet Instantiate(myPrefab, new Vector3(x + offsetX * width, y, z + offsetZ * width), Quaternion.identity); with the same y value is shown at 23 in the image? why are some of the y values different for the instantiated cube prefab.
*
for (int i = 0, x = 0; x <= width; x++) {
for (int y = 0; y <= height; y++) {
for (int z = 0; z <= width; z++) {
if (getBlock(x + offsetX * width, y, z + offsetZ * width) && (!isSurrounded(x + offsetX * width, y, z + offsetZ * width))) {
//grid[x, y, z] = new Vertex(x, y, z);
Debug.Log(y);
GameObject cube = Instantiate(myPrefab, new Vector3(x + offsetX * width, y, z + offsetZ * width), Quaternion.identity);
Debug.Log(i + "" + new Vector3(x, y, (i%(width + 1))));
vertices *= new Vector3(x, y, (i%(width + 1)));*
i++;
}
}
}
}
[206596-capture5.jpg|206596]*
*