- Home /
Question by
Memeparable · Jun 27, 2015 at 10:50 PM ·
c#arrayfloatnoise
Setting TerrainData heights to a float array?
I want to Use perlin noise to generate a terrain. The problem I am having is assigning the float array to the terrain data Here is the code. the current error is.
"Assets/PerlinTerrain/Scripts/PerGen.cs(16,29): error CS1503: Argument #3' cannot convert
float[]' expression to type `float[,]'"
Here is the code.
using UnityEngine;
using System.Collections;
public class PerGen : MonoBehaviour {
// Use this for initialization
void Start () {
TerrainData terrainData = (TerrainData)Resources.Load("Ter1");
float y = 0.1;
float x = 0.1;
float[] Heights = Mathf.PerlinNoise(x,y);
terrainData.SetHeights(0,0,Heights);
}
// Update is called once per frame
void Update () {
}
}
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Array not displaying my level best time in my level select menu 0 Answers
Monodevelop is expecting int from my float array 3 Answers
Pick between two floats 2 Answers