EzTween | Run custom Tween Eases (More of a lerp right now)

Did you ever think about running your own tween eases in an easier way? That’s why I made this library. It supports any ease animation and planned to act like a TweenService element.

It currently has the :Utilize(), :Wait(), :Run() functions. I’m planning to develop it further based on feedback and recommendations.


Basic Guide

Welcome to the tutorial! It’s actually really simple to use.

  1. Add EzTween to a location of your choice.
  2. Require it.
  3. Call:
    local myTween = EzTween:Utilize(time in seconds, target, ease function, {proporties},{values})
  4. Then run it:
    myTween:Run()
  5. You can also wait until the tween ends:
    myTween:Wait()

About the Custom Ease Functions

You only need to require a ModuleScript that has a :Get(x) method, where x is between 0 and 1.
The library will automatically call the :Get(x) method if you have one.
You can use multiple resources to create your own ease animations.

  • easings.net provides common ease animations with their functions in JavaScript format, which is easy to convert.
  • I also found this article that may help: Easing Functions Cheat Sheet
  • An awesome plugin by tyridge77 allows developers to create their own graphs for easing styles. You can access the plugin here.
    It also includes a :Get(x) method, so you can use these graphs simply by requiring them in the ease function parameter.

Example
local ez = require(game.ReplicatedStorage.EzTween)

local t1

local ite = 1
while true do
	t1 = ez:Utilize(2, workspace.joe,require(script.ExportedCurve),{"Position","Color"}, {Vector3.new(1*ite,0,0),Color3.fromRGB(85, 170, 255)})
	t1:Run()
	t1:Wait()
	ite+=1
end

Important: This is my first community resource, and my goal was to improve my understanding of OOP systems. Do not expect a comprehensive library + Personal Use

1 Like

Honestly, this is less of a Tween module and more of a lerping module (as lerps are more commonly used for moving PVInstances, while Tweens are used for that and other properties.)

It would be nice if you could use EzTween for, say, tweening number properties, or Vector3 properties, Color3 properties, etc. Also, support for custom EasingDirections (for example going forward until midway then going reverse until the start then going forward to the end) would be really cool additionally with the custom EasingStyles.

2 Likes

I also would maybe provide some default premade curves/curve modules in the post, so that users have examples to look at when making their own curves. Just a suggestion :slight_smile:

2 Likes

As I mentioned, It’s planned to act like a TweenService element. But you are right about that the module being more of a lerping module.

I actually gave 2 resources for premade curves, they just have to change the function names!

1 Like

This is really cool! i would suggest adding a function to pause/stop the tween tho.
even better is making an adjustable speed scale for the tween.

2 Likes

First Update | 1.1.0

  • Now you can use this with anything that supports :Lerp() (CFrame, vector3, color, etc.)

  • Updated the function, starting points are no more required, you will need to specifiy the property needs to be changed and it’s goal value seperately.