Quote:
var theNewPos = new Vector3(Random.Range(minXPos, maxXPos), 0, Random.Range(minXPos, maxXPos));
It looks both
x
and
z
are random picked.
var theNewPos = new Vector3(Random.Range(minXPos, maxXPos), Random.Range(minYPos, maxYPos), Random.Range(minXPos, maxXPos));
Should do the trick (if you wish to maintain randomness on the
z
axis too)