Hello guys, I have to filter out my iPhone,s noisy values which i get from the accelerometer.
so i got a sample code from unity,s website.
var AccelerometerUpdateInterval : float = 1.0 / 60.0;
var LowPassKernelWidthInSeconds : float = 1.0;
private var LowPassFilterFactor : float = AccelerometerUpdateInterval / LowPassKernelWidthInSeconds; // tweakable
private var lowPassValue : Vector3 = Vector3.zero;
function Start () {
lowPassValue = Input.acceleration;
}
function LowPassFilterAccelerometer() : Vector3 {
lowPassValue = Mathf.Lerp(lowPassValue, Input.acceleration, LowPassFilterFactor);
return lowPassValue;
}
here i get an error on Mathf.Lerp function. it says Mathf.Lerp takes the parameters (float, float, float). so what else should i use instead of this ?
any help will be appreciative.