This is weird, and I’m not sure what I’m doing wrong. When the script starts, i instance my array like follows:
int[,] board = new int[7,7];7];
But when I go to try and test the script, and update occurs, it gives me an array is out of range with the following code only
for (x=0;x<=7;x++)
{
for (y=0;y<=7;y++)
{
if (board[x,y]==0)
{
tempx=tempx+24;
}
if (board[x,y]==1)
{
GameObject disk = GameObject.CreatePrimitive(PrimitiveType.Sphere);
disk.transform.localScale = new Vector3(20,20,5);
disk.transform.localRotation = new Quaternion(0,0,962,0);
tempx=tempx+24;
}
if (board[x,y]==2)
{
GameObject disk = GameObject.CreatePrimitive(PrimitiveType.Sphere);
disk.transform.localScale = new Vector3(20,20,5);
disk.transform.localRotation = new Quaternion(0,180,962,0);
tempx=tempx+24;
}
}
tempy=tempy-24;
}
Now, ignoring the tempx and temp y (these are for positioning and currently aren’t attached to anything else) I can’t see any problems with setting up the array to update itself…help?