I have this method that is called on the game start and is part of my map generation.
void GeoGen(GameObject[] rndObj, GameObject obj02, int minAmount, int maxAmount)
{
int amount = Random.Range(minAmount, maxAmount);
Debug.Log(amount);
for (int a = 0; a < amount; a += 1)
{
int rndGeo = Random.Range(0, tempS);
float tempX = rndObj[rndGeo].transform.position.x;
float tempY = rndObj[rndGeo].transform.position.y;
Instantiate(obj02);
obj02.transform.position = new Vector2(tempX, tempY);
Destroy(rndObj[rndGeo]);
}
}
As you can see in this picture, the square on the far right edge is missing and does not have a obj02 in it’s place (in this case, the tree squares). I’m not sure what I am doing wrong. Any help will be appreciated.
