DynamicTween Release [v2]
- Note: This module was initially created for personal use but has been open-sourced. Feel free to leave feedback.
Overview
DynamicTween replicates Roblox’s TweenService, adding Bezier curve support for advanced movement animations.
It specializes in dynamic animations for Roblox instances.
Features
-
Familiar Interface: Functions similarly to
TweenService:Create(...)
for creating tweens on Roblox instances. - Bezier Curve Support: Allows you to create natural motion paths with Bezier curves.
- Dynamic Tweening: Specialized support for smooth animations of moving positions.
-
Model Tweening: Allows you to tween models, using
:PivotTo()
Example Usages
Example 1 | Basic Tween for Position
local DynamicTween = require(path.to.DynamicTween)
local part = workspace.Part -- Replace with your part
local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local propertyTable = {
Position = Vector3.new(0, 10, 0) -- Move part to this position
}
local tween = DynamicTween:Create(part, tweenInfo, propertyTable, { Play = true })
Example 2 | Tween with Bezier Curve
local DynamicTween = require(path.to.DynamicTween)
local part = workspace.Part -- Replace with your part
local tweenInfo = TweenInfo.new(3, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local propertyTable = {
Position = Vector3.new(20, 10, 20) -- End position
}
local curveOffset = Vector3.new(10, 15, 0) -- Control point for Bezier curve
local tween = DynamicTween:Create(part, tweenInfo, propertyTable, { Play = true, Curve = curveOffset })
Example 3 | Tweening Model Pivot Using CFrame
local DynamicTween = require(path.to.DynamicTween)
local model = workspace.Model -- Replace with your model
local tweenInfo = TweenInfo.new(4, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
local propertyTable = {
CFrame = CFrame.new(Vector3.new(20, 0, 20)) -- Move model to this CFrame
}
local tween = DynamicTween:Create(model, tweenInfo, propertyTable, { Play = true })
Example 4 | Pausing and Resuming Tween
local DynamicTween = require(path.to.DynamicTween)
local part = workspace.Part -- Replace with your part
local tweenInfo = TweenInfo.new(5, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out)
local propertyTable = {
Position = Vector3.new(10, 20, 10)
}
local tween = DynamicTween:Create(part, tweenInfo, propertyTable, { Play = true })
wait(2) -- Let the tween run for 2 seconds
tween:Pause() -- Pause the tween
wait(2) -- Wait before resuming
tween:Play() -- Resume the tween
Methods, Properties & Events
For more details on the methods, properties, and events supported, refer to the TweenService Documentation.
Get the Model Here
Feel free to leave suggestions or report bugs. I’ll address them as quickly as possible.