- Home /
Mathf.PerlinNoise gives the same value every time
When I enter Mathf.PerlinNoise(1,98) it gives me the same value as when I enter Mathf.PerlinNoise(54,23), or any other set of numbers. 0.4652731 every time.
I want to use it to determine wether there should be a wall or a floor at a location in a 2d square. I'm planning of using a double for loop that loops through the coordinates of the square. It should be possible to enter the coordinates into Mathf.PerlinNoise?
It might be that I do not undertand Mathf.PerlinNoise correctly, but the documentation is not very helpful. Does anyone know if I'm doing something wrong?
Answer by fffMalzbier · Apr 29, 2015 at 02:39 PM
You have to input values between 0 and 1 / fractions.
After a whole integer the results repeat.
Mathf.PerlinNoise(1,98) == Mathf.PerlinNoise(80,200) = 0.4652731
Mathf.PerlinNoise(0.1f,0.98f) == Mathf.PerlinNoise(3.1f,5.98f) = 0.5134467
Perlin noise was never ment to be random otherwise you wouldn't have a gradient across the different values which is the main purpose when using perlin noise.