How do I smoothly change a tween's duration?

I’m trying to make a brick follow a route of bricks using TweenService. But the thing I want to do, is smoothly change the duration of the Tween. I want the part to actually slow down to the to the new duration. How can I do this? Whenever I try to change the duration to like 2 seconds, it just instantly tweens the part with the new speed.
This is my code:

for i = 1, 230 do -- The amount of bricks
local v = workspace.Track:FindFirstChild(i)
local waitingtime = 1
local TweenInfo = TweenInfo.new(
		Time,
		
		Enum.EasingStyle.Linear,
		
		Enum.EasingDirection.Out,
		
		0,
		
		false,
		
		0
	)
	
	TweenService:Create(Part, TweenInfo, {CFrame = v.CFrame}):Play()
wait(waitingtime)
end

Thanks!

1 Like

U would use a Different easingStyle like Quad. Or tween the tween’s duration

Yeah but that eaingstyle brings the end speed to 0: https://gyazo.com/42f289c44677de899c14314d48f557b1
And I want it to increase/decrease to an actual speed

I’m not sure that would be possible with tweening. But maybe with a for…do loop? And adding a delay that gets incrementally bigger/smaller example: delayTime = delayTime*0.01
or changing the amount your object is moved each time it runs through the loop.

It’d recommend using lerp.
This other post sounds very similar to what you want.

1 Like

If I increase the speed, wouldn’t that affect the smoothness, if you know what I mean?

It won’t if you change the increment instead of the wait time.
The more you increment the faster it is, the less you increment the slower it is.

And I would just need to tween the speed?

If you’re just looking for more tweening styles, there’s a module for that

I’m more satisfied with your first solution, but thanks!

1 Like