Quantcast
Viewing all articles
Browse latest Browse all 26

Framerate affects speed of Lerp function

Hey! I have this code public IEnumerator MoveExample(Vector3 newPosition, float time) { float elapsedTime = 0; while(elapsedTime < time) { transform.position = Vector3.Lerp (transform.position, newPosition, (elapsedTime/time)); elapsedTime += Time.deltaTime; yield return null; } } } When changing framerate (quality setting of game), the lerping goes faster/slower. Why do this occur when I use Time.deltatime? Best regards

Viewing all articles
Browse latest Browse all 26

Trending Articles