local Dynamo = require(6244557500) -- use Id or reference the module in your game
local myEvent = Instance.new("BindableEvent")
local myObject = Instance.new("Part")
myObject.Anchored = true
myObject.Parent = workspace
local myDynamo = Dynamo.new(
{
-- Configuration
-- You can leave this table completly empty if you wish!
-- StpeType: What step to tween on. Heartbeat or RenderStepped. Heartbeat by default
StepType = "Heartbeat",
-- Speed: The speed the dynamo runs at. Can be accessed by myDynamo.Speed. 1 by default
Speed = 1,
-- Repeat: The amount of times dynamo will repeat itself rounded down. If Repeat < 0 then it'll play until paused or cancelled. 0 by default
Repeat = -1
},
{
-- Keyframes
{
-- Keyframe #1
-- Used to tween a property of a table / instance
--[[
List of available styles:
Linear Quad Cubic
Quart Quint Sine
Expo Circ Elastic
Back Bounce Smooth
Smoother RidiculousWiggle RevBack
Spring SoftSpring Standard
Sharp Acceleration Deceleration
StandardProductive EntranceProductive ExitProductive
StandardExpressive EntranceExpressive ExitExpressive
FabricStandard FabricAccelerate FabricDecelerate
UWPAccelerate MozillaCurve.
Linear by default
]]
EasingType = "Linear",
--[[
The direction to ease in.
In - Default
Out
InOut
]]
EasingDirection = "In",
-- When to start the keyframe, must be positive. 0 by default
StartTime = 0,
-- How long the keyframe should last. 1 by default
Duration = 3,
-- The values to tween from, use more than 2 to see curved results. Empty table by default
Values = {
CFrame.new(Vector3.new()),
CFrame.new(Vector3.new(10, 10, 0)),
CFrame.new(Vector3.new(20, 0, 0))
},
-- The object or table to tween on. REQUIRED
Object = myObject,
-- The property of object or table. REQUIRED
Property = "CFrame",
-- The instance the move this part relative to. nil by default. Exampe: Player.Character.HumanoidRootPart will keep the part moving relative to the player's character
UseInstanceSpace = nil,
-- If true, dynamo will tween this object and all of its children. Great for people who hate wasting memory with models.
MoveChildren = true,
}
},
{
-- Bindable Events
{
-- Fires the BindableEvent at Time in Dynamo
BindableEvent = myEvent,
Time = 2
}
}
)
-- IMPORTANT
myDynamo.Play()
--[[
You can also do:
myDynamo.Pause(); Paused
myDynamo.Cancel(); Stops and resets values
myDynamo.Speed = x; Changes the speed
print(myDynamo.TimesRepeated);
print(myDynamo.Time);
print(myDynamo.PlaybackState);
]]
-- Debugging Events
function GetEventPrinted(name)
return function()
print(name.. " fired.")
end
end
-- All of Dynamo's Events
print("Dyanmo", myDynamo)
myDynamo.Completed.Event:Connect(GetEventPrinted("Completed"))
myDynamo.Played.Event:Connect(GetEventPrinted("Played"))
myDynamo.Paused.Event:Connect(GetEventPrinted("Paused"))
myDynamo.Repeated.Event:Connect(GetEventPrinted("Repeated"))
myDynamo.Cancelled.Event:Connect(GetEventPrinted("Cancelled"))
-- Event Example
myEvent.Event:Connect(GetEventPrinted("myEvent"))
Hi, was just wondering if there was any way you could upload the source to GitHub or something of the sort? I’m on mobile and just wanted to look over the module.
You made my day! After months of searching a good Tweening module for my train I finally found the perfect one, it works perfectly, thanks a lot! @Ehonix .
Also your dynamo module link doesn’t send you to the module page, be aware ;).