float n = 0;
float s = 1;
float j = 1;
float t = 0;
for (int i = 0; i < NumNoise; i++)
{
n += Mathf.PerlinNoise(x * s + Seed, y * s + Seed) * j;
s *= 2;
j *= 0.5f;
}
float r = (Mathf.PerlinNoise(x * 10.3f + Seed + 166.32f, y * 10.3f + Seed + 166.32f) - 0.5f) * 100;
return n + r;
This is code for a terrain generation. Float r is the thing that is bugged. It is not being added to the main float n. This is supposed to simulate rivers, but it isn’t doing anything.