Lerp API , Replaces Easing Styles & Directions

I’ve made a Lerp API to replace all the easing STYLES and DIRECTIONS.

Free Model : https://www.roblox.com/library/4898841043/Lerp-API

If you encounter any bugs or errors please dm me on discord : Prexxo #6085

Code Example :

local LerpAPI = require(script:WaitForChild("Lerp API"))

local RunService = game:GetService("RunService")

local Object = game.Workspace.Object

local Point1 = game.Workspace.Point1
local Point2 = game.Workspace.Point2
local Point3 = game.Workspace.Point3
local Point4 = game.Workspace.Point4

local Start = Point1.Position
local End = Point4.Position

for i = 0, 1, 1/60 do
	Object.Position = LerpAPI.Bounce(Start, End, i)
	RunService.Heartbeat:Wait()
end
LerpAPI.Bounce(Start, End, 1)

Result https://gyazo.com/403f290bfa98bab49303df7df5474e44

Note : Leaving the 4th argument blank / nil will result the easing direction to be “In” by default.

19 Likes

Can you explain what it does? I don’t really get it.

You should post this to #resources:community-resources also please add some example usage and description

1 Like

This is lerps but with Styles, lerps are better than tween, but people dont use because tween have Styles And directions, so Preexoo created that module that can lerp with styles and directions like tween.

Read that ^ ik because he is my friend

Its locked so i cannot move it , Example usage is in the free model READ instructions but ill give an example on how to use it and a few gifs

1 Like

that looks cool, but TweenService is much easier to use.

2 Likes

However, Tween is very inefficient compared to Lerp because Tween creates instances, and instances use a lot of the server, so Lerp is much better

This isn’t
really inefficient. Yes, tween creates instances but isn’t parenting then so it isn’t consumimg sever/client memory.

It is, not like another instances, but Still consuming, because that lerp is better

The reason I made it was for the people who want to get their code “quality” to the fullest. Tweening uses lerp methods (Linear Interpolation), I’ve taken original formulas from Roblox as well so it look the same anyways but here are a few reasons why you should consider switching to lerp : Tweening creates an instance ( Instances are pretty heavy to create ), as well as a new thread for every property u want to tween, with lerping u can handle it in 1 thread so as the result it will cost less to run, be more efficient and you have more control over.

1 Like

wouldn’t adding a wait() to a heartbeat completely nullify the heartbeat?

if you are talking bout to switch it to

RunService.Heartbeat:Connect(function() end)

then no, the reason is every “Connect” event creates a new thread which is not that bad as long as its not yielded and no RunService.Heartbeat:Wait() doesnt “nullify” it .

1 Like

You are correct instances that arent parented dont consume any resources but in terms of efficiency and cost with lerping u can achieve way better results. Lerping itself already costs less and is more efficient but making a handler which would Lerp everything in one 1 thread , that would make it superior compared to tweening ( Tweening creates a new thread for each property that you tween)

Can you at least change the parameters? It is better to have arguments like at tween because the arguments at the functions of this module isn’t really looking good and usefull.

Sorry for the late reply, basically I’ve made this so people who are experienced scripters can replace the tweening without writing the formulas down themselves. Basically tweening creates a new instance, a new thread then uses LERP to tween it. Recently I made a Lerp Handler which allows me to lerp anything ex. lerp the size of 10 parts without creating a single thread and ofc its efficient its also compatible with CFrame, UDim2 (Vector by default). I’m still thinking if ill release it or not