Dynamo: Supports Multiple Tweens, Bezier Curves, & Model / Part Movement

Dynamo

Tween curves, whole models or children of part, sync multiple tweens with their own starting times, and move parts relative to an object’s space!

Built off of BoatTween Module

Dynamo Module

Ehonix/Dynamo: A procedural animator for Roblox (github.com)

How To Use

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"))
60 Likes

This looks really cool!

However, I would love to see some gifs/videos of products made using it. I assume these would be present in the tutorial you plan to make.

5 Likes

Just updated everything and provided an example and place you can mess around with. Thanks for the feedback!

2 Likes

Great resource - this makes Bezier curves a lot easier to use for beginners :slight_smile:

2 Likes

Update

Changed the interface from parameters to tables
Added Boatbomber’s tweening module styles
Added a tutorial
Plugin → Uploaded model

4 Likes

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.

1 Like

Amazing, truly amazing. Now I dont have to rely on complicated lerping to create a train!

1 Like

Ehonix/Dynamo: A procedural animator for Roblox (github.com) here you go
:slight_smile:
also, the entirety of EasingFunctions.lua, Lerps.lua, and Bezier.lua are created by @boatbomber .

2 Likes

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 ;).

1 Like

Thanks! Glad I was able to help.

Hi,

Can this module be used to render on the client side?

Regards
Julian

suggestion : make a tutorial for the use of this module

some people are still confused with scripts and stuff i think

is it just me or is it going to take a few hundred years to learn how to module works