Hello, I need to control the result of Random.value using a logarithmic equation (and eventually other equations). I’ve been researching logarithms, and even though the desired result is a logarithmic curve, the way to get there isn’t clear at all. How would I apply a simple graphic equation to a random value?
I am currently issuing an if statement that looks like so:
if(Random.value > (varyingVariable/100)){
doStuff;
}
My variable is between 0 and 100. This might be wrong, but if the lower values come out more often, then it should work… I think
I need to modify either the random value, or my variable, to get a lower number to return true more often than a higher number. Anyone can help? Am I missing some math knowledge here (most probably)?
Thanks a ton!
PS, I am working on a true to life simulation, and will eventually need to adapt this randomness to other equations. Something modular would be great. I will also be attending some much needed classes on maths next semester (college), so hopefully I might be able to answer myself… fingers crossed. Thanks for any help.