Instantiate a cube for each grid point into the scene

Hello i want to know how i can instantiate a cube for each grid point well i start the game

I tried to create a script but i dont have any idea how i can do it

Thanks if you help me

Just a guess but if you dont know how to do that then did you make the grid by hand?

The simplest way to do it is using a nested for loop:

GameObject cube;
int width = 5;
int height = 5;

Gameobject[,] cubes = new GameObject[width, height];

for(int x = 0; x < width; x++){
for(int y = 0; y < height; y++){

cubes[x, y] = Instantiate(cube,
new Vector3(x, 0, y), Quaternion.identity);