Created
July 22, 2019 08:31
-
-
Save bartwttewaall/f28a89e28b00371481386aad6b13019e to your computer and use it in GitHub Desktop.
Update as many times in steps of fixedDeltaTime until we have caught up to the elapsed time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float timer; | |
void Update () { | |
timer += Time.deltaTime; | |
while (timer >= Time.fixedDeltaTime) { | |
timer -= Time.fixedDeltaTime; | |
// calculate single step | |
// .. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment