Normalizes a given range (min and max) to a progress (a value between 0 and 1) For instance, let's say you have a range of 325-1450. You want 0% = 325 and 100% = 1450. You can pass a value 420 and this will return the progress (percentage).
mathf.getProgressInRangeByValue(2, 0, 10) // 0.2 mathf.getProgressInRangeByValue(10, 0, 10) // 1 mathf.getProgressInRangeByValue(7, 2, 12) // 0.5 Copy
mathf.getProgressInRangeByValue(2, 0, 10) // 0.2 mathf.getProgressInRangeByValue(10, 0, 10) // 1 mathf.getProgressInRangeByValue(7, 2, 12) // 0.5
The low end of the range.
The high end of the range.
The progress within the range.
Normalizes a given range (min and max) to a progress (a value between 0 and 1) For instance, let's say you have a range of 325-1450. You want 0% = 325 and 100% = 1450. You can pass a value 420 and this will return the progress (percentage).