I want to have a 2D array which has a number of rows relating to the number of game objects and 3 columns. I want each row to have the name of the game object and its position and velocity. Is this possible or are there a clash of data types? I was thinking this:
int barrelCount = GameObject.FindGameObjectsWithTag("Barrel").Length;
barrelData = new GameObject[barrelCount, 3];
//does this need to be less than or equal to?
for(int i = 0; i<barrelCount; i++)
{
for(int j = 0; j<barrelCount; j++)
{
for(int k = 0; k<barrelCount; k++)
{
barrelData[i,j,k] = [GameObject.FindGameObjectWithTag("Barrel"), barrelPos, barrelVelo];
}
}
}
I know the above wouldn't work code wise, you cant ask for position and velocity from finding a game object, but its along the lines of what I would like. Am I going the wrong way about this?