WolfiTween: Tweening with Lerp - A Flexible and Lightweight Module

(I don’t know if such modules already exist, but I couldn’t find them)

Hello, developers! Let me introduce WolfiTween, a custom tweening module designed for animating a single property with lerp-based interpolation. I’ve worked hard to make it as similar as possible to TweenService so that it’s easy to understand and use for everyone. Here’s what makes it special:


Key Features

  1. Similar to TweenService for Ease of Use:
    WolfiTween’s structure are designed to feel familiar to anyone who’s used TweenService. If you’re already comfortable with creating tweens, transitioning to WolfiTween will be a breeze.

  2. Built-in Easing Styles:
    WolfiTween includes a selection of built-in easing styles to cover a wide range of animation needs:

    • Linear
    • Quad
    • Cubic
    • Quart
    • Quint
    • Sine
    • Back
    • Bounce
    • Elastic

    Additionally, you can define custom easing functions, making WolfiTween flexible for unique animation curves.

Untitled video - Made with Clipchamp (2) (1)

  1. Control Animation Smoothness:
    Adjust the animation smoothness with the Optimization setting. Lower values make animations smoother, while higher values reduce CPU usage.
    • At min. (0) Optimization, I’ve observed around 3% usage in the Script Performance tab, even with a large number of tweens.

  1. Support for Core Types:
    The module supports tweening for common data types like CFrame, Vector3, UDim2, Color3 and Numbers, making it flexible for most use cases.

Potential Downsides

  • Not Guaranteed to Be More Efficient than TweenService:
    Roblox doesn’t allow us to measure TweenService’s CPU usage directly, so I can’t say for sure if WolfiTween is more optimized. Since it uses lerp for interpolation, it might be more or less efficient depending on your situation.
    I’d really appreciate feedback if you have the means to test this!

  • Possible Bugs and Unoptimized Code:
    I’m not a professional scripter, and this module has been rewritten and adjusted so many times that I might have introduced inefficiencies or bugs. If you spot any issues, feel free to fix them—or let me know so I can improve it.


A Work in Progress

  • Custom Modifications Encouraged:
    If you want to tweak the module to suit your needs, go for it! If your modifications aren’t major, I’d appreciate it if you could credit this original module.

  • I’d Love Your Feedback:
    I built this over ~5 hours with breaks, and it’s the best I can manage for now. If you find WolfiTween useful, or if you have ideas for improvements, please let me know!
    I’m especially curious if it’s more optimized than TweenService.


This module is far from perfect, but I hope it makes animations easier for someone out there. If you test, improve, or even rebuild WolfiTween, that would mean a lot to me! Let me know your thoughts, and I’ll be looking forward to any feedback.

USAGE:

Module: https://create.roblox.com/store/asset/116303583570035/WolfiTween
Tween script:

 local WolfiTween = require(path.to.WolfiTween)
 local tweenInfo = WolfiTween:TweenInfo(2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
 local tween = WolfiTween:Create(part, tweenInfo, { Position = Vector3.new(0, 10, 0) })
 tween:Play()
 tween:AwaitCompletion()

How to create EasingStyle?

  1. In the module you should create a function in the table with the name of your style

  2. When creating tweeninfo, instead of enum.EasingStyle, specify a table with a Name parameter that equals the name of your style

1 Like

Should be moved to #resources:community-resources

I doubt that this is a useful resource, as it might be worse than TweenService. That’s why I want to hear feedback first, and only then tell everyone to use it.