Skip to content

Instantly share code, notes, and snippets.

@Stiner
Created July 22, 2019 01:00
Show Gist options
  • Save Stiner/8de1b4b94d8a18171e3eedb8045ca1aa to your computer and use it in GitHub Desktop.
Save Stiner/8de1b4b94d8a18171e3eedb8045ca1aa to your computer and use it in GitHub Desktop.
Movement
// Smooth
x = lerp(x, target_x, 0.1);
x += (target_x - x) * 0.1;
// Spring
spdx = lerp(spdx, (target_x - x) * 0.5, 0.2);
x += spdx;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment