I know its because i’m using the values wrong, but i’ve been playing with them for a while and haven’t been able to find the correct ones.
`using UnityEngine;
using System.Collections;
public class CubeGrid : MonoBehaviour {
public Transform grassLand;
public Transform dirtRoad;
public Transform city;
public int xCubes;
public int yCubes;
private int x = 0;
private int y = 0;
void Start () {
while(y < yCubes)
{
if(x == xCubes)
{
y++;
x = 0;
}
while(x < xCubes)
{
if(Random.value <= .8)
{
Instantiate(grassLand, new Vector3(x, y, 0), Quaternion.identity);
}
if(Random.value <= 0.15)
{
Instantiate(dirtRoad, new Vector3(x, y, 0), Quaternion.identity);
}
if(Random.value <= 0.05)
{
Instantiate(city, new Vector3(x, y, 0), Quaternion.identity);
}
{
x++;
}
}
}
}
}`
If somoene could tell me how to properly set up the percentages i’d be thankful.