This is probably a very simple question for most of the smart guys here. I am looking for the best way to translate a value into another range.
Let’s say I have value (x) that can be in a range between 0 (min) and 500 (max).
Now I want to translate that value to a range of -1 and +1.
So if x=0
the result would be -1
, x=500
it would be +1
and x=250
would be 0
.
This can probably be done with something like Mathf.Lerp or InverseLerp but I can’t quite figure out how…