Here is what im trying to do.
I have an array of gameobjects that are empty and are being used for spawnLocations. I want to be able to access the array element and then have it return to me the vector3 location of that gameObject in the array? has anyone done this before?
Instantiate(Blocks[0], SelectRandomLoc(), Quaterion.identity);
what i need is for SelectRandomLoc() function to return to me a vector3 location for the instantiate to use. my SelectRandomLoc function has a random range in it to pick a location from my array of locations. I also am trying to have it set up with a while loop so that it will fill another array that has integers in it one at a time. then when that number in the int array if filled it will also fill the location array at the same time so that i can make sure that the same location is not picked twice.
This is what i have so far for that:
Transform SelectRandomLoc()
{
int rnd = Random.Range(0, 10);
while(FilledLocations[Random]==0)
{
// Fill the location with an int
}
return ScreenSpawnLoc[rnd].gameObject.transform;
}