Hello Developers! I’m learning lerping and I wanted to compare it to tweening. I’ve tested both lerping and tweening to a part’s CFrame and I don’t really see the difference. Are there any advantages and disadvantages for using Lerping and Tweening and which one should I use over the other? ![]()
With lerping you can have your own custom easing styles and functions (you ain’t limited to quint, quad, elastic, etc…)
Not all properties are tweenable so you would have to use Lerp and a RunService connection
Wait you can make a custom easing style and a function? How? ![]()
Well if you think about it, you just give a function a number 0-1 and it returns another number 0-1 that isn’t linear, giving it a cool style
You can create one using this amazing plugin
Here is an example of something I quickly wrote (not related to the plugin)
function customEasing(t)
return (t^0.4) * math.sin(t * math.pi * 1.5) * 0.5 + t * 0.5
end
Credit to ChatGPT for above function
by using smart maths (or chatgpt) (or what @beoe7 just said above). lerping changes the position of a part every frame based on the alpha, meaning the point in between the two positions you are lerping. tweening is more like for animations and stuff not adapting movements. like lerping on a camera is better because the camera is constantly moving, instead of tweening, if you get what i mean.
Should use both depending on what you’re doing..
Lerping = frame-by-frame control, good for chasing moving targets, no built-in easing.
Tweening = timed auto-animation, built-in easing styles, fire-and-forget.
Use lerp for dynamic targets, tween for fixed animations.
I recently learned you could use TweenService:GetValue(Alpha, Enum.EasingStyle, Enum.EasingDirection) which has helped me a lot!
If you are looking for dynamic tweening, roblox has made official tutorial about new tweenservice feature
Oh no, I was just trying to find differences between lerping and tweening and which one to use over the other but thanks for the suggestion though
Thanks, will remember it for the future!
TweenService is kinda bloated if you want to use it for a lot of constantly changing properties;
Althrough its fine if you want to animate UI.
I suggest using custom TweenServices cause they should have less overhead.
Oh alright, I will try doing that ![]()
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.