Mathf.InverseLerp Manual     Reference     Scripting  
Scripting > Runtime Classes > Mathf
Mathf.InverseLerp

static function InverseLerp (from : float, to : float, value : float) : float

Description

Calculates the Lerp parameter between of two values.

var walkSpeed = 5.0;
var runSpeed = 10.0;
var speed = 8.0;
// parameter is now 3 / 5
var parameter = Mathf.InverseLerp(walkSpeed, runSpeed, speed);