I am trying to create a system in unity where a number is generated (with a range from 0 to 9) from 3 float inputs. This is to create a procedural game where being in the same location always gives the same output. Because of this, I don't just want to use an in-built random method, as it would give different results each time. However, I am struggling to create a method that can achieve this.
To summarise:
I want to be able to put in 3 values, e.g.:
[3.2344234, -44.33030, 0.22222]
And have the method come up with a number like:
[2]
But I don't want to use an in-built method.
This is what I have tried so far - It's a bit of a mess:
public float randomNumber(float x, float y, float z)
{
float stage1 = (float)((Mathf.Sign(x + 512) / Mathf.Cos(z + 42) + Mathf.SmoothDampAngle(z,y,ref(z),x) * Mathf.Atan2(y - 15,z)) / 24 + 5 * 6)%7.2f;
string stage2 = stage1.ToString();
int stage3 = (int)stage2[5];
float result = stage3;
return result;
}
Any suggestions to properly generate random numbers are most welcome.