Skip to content

Instantly share code, notes, and snippets.

@bartwttewaall
Created July 22, 2019 08:31
Show Gist options
  • Save bartwttewaall/f28a89e28b00371481386aad6b13019e to your computer and use it in GitHub Desktop.
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
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