I was following a tutorial but when I finished putting the code I got an error and I don’t know what’s wrong.
public class Chessboard : MonoBehaviour
{
private const int TILE_COUNT_X = 8;
private const int TILE_COUNT_Y = 8;
private GameObject[,] tiles;
private void Awake()
{
GenerateAllTiles(1, TILE_COUNT_X, TILE_COUNT_Y);
}
private void GenerateAllTiles(float tileSize, int tileCountX, int tileCountY)
{
tiles = New GameObject[tileCountX, tileCountY];
for (int x = 0; x < tileCountX; x++)
for (int y = 0; y < tileCountY; y++)
tiles[x,y] = GenerateSingleTile(tileSize, x, y);
}
private GameObject GenerateSingleTile(float tileSize, int x, int y)
{
GameObject tileObject = new GameObject(string.Format(“X:{0}, Y:{1}”, x, y));
tileObject.transform.parent = transform;
return tileObject;
}
}