
It looks like you're new here. If you want to get involved, click one of these buttons!
fowling Brakey's GENERATING TERRAIN in Unity - Procedural Generation Tutorial, at about 6:00 of the video I got the invalid token error this is my script so far
public class terrian_gen : MonoBehaviour
{
public int width = 256;
public int height = 256;
public int depth = 20;
public float = 20f;
void start ()
{
Terrian terrian = GetComponent<Terrian>();
terrian.terrianData = GenerateTerrian(terrian.terrianData);
}
TerrianData GenerateTerrian (TerrianData terrianData)
{
terrianData.size = new Vector3 (width, depth, height);
terrianData.SetHeights(0, 0, GenerateHeights());
return terrianData;
}
float[,] GenerateHeights ()
{
float[,] heights = new float[width, height];
for (int x = 0; x < width; x++)
{
for (int y = 0; y < height; y++)
{
heights[x, y] = CalculateHeight(x, y);
}
}
return height;
}
float CalculateHeight (int x, int y)
{
float xCoord = x / width * scale;
float yCoord = y / height * scale;
return Mathf.PerlinNoise(xCoord, yCoord);
}
}
Answers
Where are you getting the error, on which line. Show the Picture of your console.
It is on the untiy engin not the consle
Yes, I know. How do you know that there is an error? I was talking about Unity's Console Window