Unity adding element to 2D array list

I have an array list chunkData and need to add values with an index using a for loop:

List<int[,]> chunkData = new List<int[,]>(); 
for (int i=0;i<=x;i++){
	for (int j=0;j<=y;j++){
		chunkData[i,j] = GetChunkPointData(i,j);
	}
}

I am being thrown the error “no overload method for this takes 2 arguments”

Try using a Hashtable. It’s another kind of list which takes a key and a value, the key being the index.

Hashtable chunkData = new Hashtable();
for(int i = 0; i <= x; i++){
      for(int j = 0; j <=y; j++){
         chunkData.Add(i, j);
          
      }
}

@RevivedBear

    List<List<int>> chunkData = new List<List<int>>(); // this is how you define a 2d generic List.
     for (int i=0;i<=x;i++){
         chunkData.Add(new List<int>());
         for (int j=0;j<=y;j++){
             chunkData*.Add(GetChunkPointData(i,j));*

}
}