Hi, I’m trying to get a smooth movement with the camera from one spot to another and i used Vector.Lerp for it but it blatently ignores my lerptime i put in it. Although i see that my time variable is getting incremented correctly it just lerps way to fast. What am I doing wrong here?
public float lerpTime = 12f;
IEnumerator CameraMovementTransition(Transform beginPosition, Transform endPosition)
{
isMoving=true;
float time = 0.0f;
while (time < 1.0f)
{
time += Time.deltaTime * (Time.timeScale/lerpTime);
Debug.Log(time);
transform.position = Vector3.Lerp(beginPosition.position,endPosition.position,Mathf.SmoothStep(0.0f,1.0f,Mathf.SmoothStep(0.0f,1.0f,time)));
transform.rotation = Quaternion.Slerp(beginPosition.rotation,endPosition.rotation,Mathf.SmoothStep(0.0f,1.0f,Mathf.SmoothStep(0.0f,1.0f,time)));
yield return null;
}
isMoving = false;
}