basically its a randomly generated topdown view tile map but i want the tiles to spawn at intervals of 0.64 so they dont overlap.
Heres my code:
public class newMapGen : MonoBehaviour
{
public int tileTypes;
public int maxX = 64;
public int maxY = 64;
bool runLoop = true;
public int tilesss = 0;
public System.Collections.Generic.List<GameObject> tiles = new System.Collections.Generic.List<GameObject>();
private GameObject Grass;
private GameObject Dirt;
private GameObject Rock;
private GameObject Gold;
void Start()
{
{
while (tilesss < 4096)
{
GameObject tileInstance;
tileInstance = Instantiate(tiles[Random.Range(0, tileTypes)]) as GameObject;
tileInstance.transform.localPosition = new Vector3(Random.Range(0f, 64f) * 0.64f, Random.Range(0f, 64f) * 0.64f, 0);
tileInstance.transform.parent = transform;
tilesss += 1;
}
}
}
}
Any help is appreciated 
You didn’t actually ask a question, you just stated what you are trying to do and pasted your code. What is wrong or incomplete with it?
I’ll point out, though, that you should always set the parent transform BEFORE you set a LocalPosition, otherwise it’ll be set relative to the old parent, which is not intended. That means you should switch those lines, making the parent be set first.
Other than that, you never set your list up, and that’s probably what you’re perceiving as the problem. Try adding this directly above your “while” statement:
tiles = new System.Collections.Generic.List<GameObject>() { Grass, Dirt, Rock, Gold };
The blank spaces are because you’re positioning the tiles randomly, which I assumed was intended. If you want every tile in the grid to be filled, you should do a double loop instead of random. Try this code:
void Start()
{
for(int x = 0; x < 64; x++)
{
for(int y = 0; y < 64; y++)
{
referenceTiles = Instantiate(tiles[Random.Range(0, centerPointVariety)]) as GameObject;
referenceTiles.transform.parent = transform;
referenceTiles.transform.localPosition = new Vector3(x * 0.64f, y * 0.64f, 0);
}
}
}