public void createMatrix() { for (int x = 0; x < gridSize.x; x++) { for (int y = 0; y < gridSize.y; y++) { for (int z = 0; z < gridSize.z; z++) { Vector3 input = new Vector3(x, y, z); Vector3 pos = isoHelper.XYToIso(input); blockGO[x, y, z] = Instantiate(block_GO, pos, Quaternion.identity); blockGO[x, y, z].GetComponent <BlockBehaviour>().blockType = BlockBehaviour.BlockTypes.AIR; blockGO[x, y, z].GetComponent <BlockBehaviour>().posOnGrid = input; } } } }