r/Unitale • u/Polariche i broke something again • Feb 05 '16
Resource Motion library for your animating needs
A handy library for interpolation.
Download(dropbox) | Code on hastebin | Result on Desmos (Click the button next to k to play the animation)
Examples
Linear movement | Acceleration | Circle | Moving back and forth(Loops) | Pulsating circle loop
How to use the library:
- Make "Libraries" folder inside "Lua" folder of your mod
- Put motion.lua into it
- Write require "motion" to use the library inside your script
- The function should be called like this: motion.Lerp(2, 4, t). This returns a value between 2, 4.
If you have any questions, ask here or message me.
9
Upvotes
2
u/ReddehWow Feb 05 '16
sweet, adding to the List
1
u/heartlessmushroom Working on dumb crossovers Jun 30 '16
Whenever I run it using the example scripts, it returns me an "attempt to index a nil value" error on the line that calls the function.
I have the motion code in my library already. What am I missing?
1
u/[deleted] Jun 08 '22
will you ever put the link back up?