Question by
CyberModeSoftware · Jul 23, 2021 at 01:18 AM ·
updatelerptime.deltatimelimitinput.acceleration
Why Mathf.Lerp dosen t work correct?
I want to make steering sistem based on Input.acceleration.x movement and I need to have sensitivity of movement but when i use Mathf.Lerp"(float a , float b , time)" time section when I decrease it to go slowly on point limit the movement under my limit variable
public void SensorSteer()
{
m_steeringAngle = Input.acceleration.x*maxSteerAngle* SteerSensityvity;
m_steeringAngle = Mathf.Lerp(Input.acceleration.x, m_steeringAngle, SteerSensityvity);
m_steeringAngle = Mathf.Clamp(m_steeringAngle, -maxSteerAngle, maxSteerAngle);
frontDriverW.steerAngle = m_steeringAngle;
frontPassengerW.steerAngle = m_steeringAngle;
}
Comment
Answer by rage_co · Jul 23, 2021 at 05:48 AM
Lerp has to be done in a continous method like update for it to work, (plus you need to multiply the time with Time.deltaTime in the Update() method, else it'll be an almost instant transition with high enough framerate
Your answer
Follow this Question
Related Questions
Light intensity Lerp not functioning properly 1 Answer
Does FIxedUpdate get called every 0.02 seconds? 2 Answers
Time.DeltaTime Bug 1 Answer
Physics using Time.deltaTime? 1 Answer