I fixed lerping #2136
VirtuGuy
started this conversation in
Show and tell
I fixed lerping
#2136
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A ton of things in Friday Night Funkin's source code uses lerp. Icons on every beat, camera zooming, the freeplay menu, etc.
Though the one problem was that it worked differently on different framerates. Luckily, I have fixed this problem with a little math.
The way lerp works is that it's a little math that goes like: a + (b - a) * ratio.
Here's the lerp calculation that works for different framerates: a + (b - a) * Math.pow(ratio, (FlxG.elapsed / (1 / 60)))
Beta Was this translation helpful? Give feedback.
All reactions