Quick & Simple Tweens with SwiftTween!

hey guys, I would like to share with y’all a quick and simple tweening module that I made
this module allows you to create a tween on command, and psst, no extra variable declaration fluff needed! :derp:

Quick & Simple Tweens with SwiftTween!

this module is meant to be simple, so it showcases 2 features:

1. swiftTween:CreateTween() :robot:

this is the meat of the module! it allows you to create a tween using only one call, and the parameters will go into the brackets, as shown below:

(one more thing to note, the “yield” parameter asks if you want to wait for the tween to finish before continuing with the next line of code)

swiftTween:CreateTween(instance, tweenTime, easingStyle, easingDirection, repeatCount, reverses, delayTime, propertyGoal, yield)
Another variation (more clean and readable, but long)
swiftTween:CreateTween(
	instance,
	tweenTime,
	easingStyle,
	easingDirection,
	repeatCount,
	reverses,
	delayTime,
	propertyGoal,
	yield
)

Example:

local swiftTween = require(game.ReplicatedStorage:WaitForChild("SwiftTween"))
local part = workspace.Part

--accepts BOTH strings and Enums for the easeStyle and easeDirection
--goin' up!
swiftTween:CreateTween(part, 3, "Linear", "In", 0, false, 0, {Position = part.Position + Vector3.new(0, 3, 0)}, true)
--comin' back down!
swiftTween:CreateTween(part, 3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0, {Position = part.Position - Vector3.new(0, 3, 0)}, true)

2. debugMode :bug:

wondering why your tween isn’t tweening? well, debugMode will allow you to detect what is actually going into the parameters, it could be a simple screw up by you, or rubbish parameters sent by exploiters!

for this to work, you must go into the module and change the boolean:

--// Debugging area
local debugMode = false --Change this value!

Link to the module:

I hope this module helps, it is free for public use, but if possible, please credit me :happy3:

1 Like

sidenote: this is my very first published module, so please do give me feedback, and constructive critism if possible! :happy2:

This is just a TweenService wrapper, that does the thing that anyone else can make via little amount of time, also amount of arguments for a function is too much. There’s a lot of problems with roblox’s tweens itself, that is why programmers don’t use it. Also there is a lot of not needed things done (creating new tweeninfo than utilizing a single one. Debug mode is not helping.

2 Likes

also you could use type function for lua types instead of typeof to gain a little perfomance boost.

But… why?
This just seems like a standard TweenService wrapper without really anything new added.. the name suggests it’s a Fast Tween module.

oh, what problems do tweens have actually? I’ve never heard of any issues arising before

imo, creating Tweens can get tedious after a while (making a new tweeninfo for each tween, creating the tween, then playing it), so I wrote this module to compile it into one call

yep, the name suggests “fast” because it’s quick to install and utilize

They’re making a new thread each time you play them (potential memory leak), they’re very linear (this is mostly about position), and they do a lot of not needed underground work and returning a little bit too much information. This makes them slow, server side does things on server, which destroys replication queue, which is already small (50KB/s), the needing in declaring other things just to declare a thing that is declared last in arguments of a constructor, and so on.
They’re just a headache to do, that’s why scripters make their own algorithms that delete the not needed work, doing things on client only (because server doesn’t need to know what position part is in since it mostly useless), add functionality (like Bezier Curve, Spring) and destroy declaring problems.

That’s… that’s a really weird reasoning for the name, nigh every module is easy to implement out of Roblox’s inherit design.

Additionally, this module takes longer to throw into a game than just creating tweeninfos, no offense… there’s functionally no reason to utilize this.

why use this when I can do

game.TweenService:Create(instance, TweenInfo.new(1), {
    Position = Vector3.new(0, 5, 0)
}):Play()