Hi,
I have the following snippet of code :
void changePathCurvature()
{
// x - Get current value of CurvatureX
currentCurvatureX = x;
// newCurvatureX = Random within a range of -50 and 50
newCurvatureX = (Random.Range(-50.0f, 50.0f));
// x = Lerp currentCurvatureX to newCurvatureX over timeInterval
x = Mathf.Lerp(currentCurvatureX, newCurvatureX, timeInterval);
// y - Get current value of CurvatureY
currentCurvatureY = y;
// newCurvatureY = Random within a range of -50 and 50
newCurvatureY = (Random.Range(-50.0f, 50.0f));
// y = Lerp currentCurvatureY to newCurvatureY over timeInterval
y = Mathf.Lerp(currentCurvatureY, newCurvatureY, timeInterval);
}
it works, but the lerp does not do what is is supposed to do, I want it to smooth from a to b over a timeInterval I have set, it currently just jumps into position, I’m aware of it, and have tried variations within the code use time.time and time.deltaTime and nothing is really working out for me, any help would be greatly appreciated.