Type 'object' does not support slicing - Array help!

Hi,

My array isn't working, and I have no idea how to fix it. The array information in the documentation is rather limited. I removed the unnecessary parts of my script to get the meaning across:

var record : Array:
var arrayNumber : int = 0;
//globalScript.globalScript.generation = global variable, integer, increases by 1 every 10 seconds or so
//globalScript.globaltime = global variable, the time in seconds. it resets for every generation

Update()
    {
    record[globalScript.generation][arrayNumber] = Array()
    record[globalScript.generation][arrayNumber][0] = globalScript.globaltime;
    record[globalScript.generation][arrayNumber][1] = position; //the position of my object, defined elsewhere

    arrayNumber++;

    // if (first of the generation) { arrayNumber = 0; }
}

Does anyone know how to properly insert arrays in to arrays?

I'm desperate! Please help!

Thanks

Do you really want a multidimensional array?

It looks more like you want an array of objects.

If you want multidimensional arrays, I think C# is where you need to be working, I can't figure out the syntax in javascript, it may not be possible: ill repost if I figure it out. Here is the C# code to do it:

int[,] blah = new int[2,3];

Take a look here for more info C# MSDN Multidimensional arrays

Not sure if this helps:

var cells = [
	[0,1,1,0],
	[1,1,1,1],
	[1,1,1,1],
	[0,1,1,0]
];

for (var rowNum = 0; rowNum < cells.length; rowNum++)
{
	for (var colNum = 0; colNum < cells[rowNum].length; colNum++)
	{
		cell = cells[rowNum][colNum];
	}
}

Implicitly creating your array using the array access operator `[]` instead of `new Array()` gives you the sort of access I think you are looking for.

There are also ArrayLists, Dictionaries and Hashtables. Check your docs that came with Unity for more info.