How to update a tween while playing?

I’ve run into this problem: the parts need follow every point with tweens, but the part updates its speed when it finishes the tween

I’ve tried some solutions but I didnt find a way to fix this

this is what happens when I try to update the speed:

the code without any changes:

if true then
	if Nodes["Node" ..i].BrickColor == Config["Neutral"].Value then
		Tween:Play()
		Tween.Completed:Wait()
	elseif Nodes["Node" ..i].BrickColor == Config["Station(Detachables)"].Value then
		TweenStationDetachables:Play()
		TweenStationDetachables.Completed:Wait()
	elseif Nodes["Node" ..i].BrickColor == Config["accellerator(Detachables)"].Value then
		TweenEntryDetachables:Play()
		TweenEntryDetachables.Completed:Wait()
	else
		Tween:Play()
		Tween.Completed:Wait()
	end
end

I would really appreciate it if anyone could find the solution

1 Like

Lerping the thing instead can work. I didnt see anyone ever change the speed of a tween mid-tween.

I actually dont know how lerps can work on following nodes
also I’ve tried putting :Lerp() but the parts wont move
maybe it needs to be unanchored?

you don’t need to “Lerp” the part, instead what you wanna do is Lerping the CFrame like this:

Part.CFrame = Part.CFrame:Lerp(Destination_In_CFrame, AlphaVariable)

1 Like

now I understand, thank you!
I’ll try laterly and see if works

The :lerp returns lerped value of the position or cframe you input. so you have to do

thing.CFrame = thing.CFrame:lerp(target,0.01)
(oh they explained alr)

looks like this isnt linear, that makes the part faster on the start and then it goes everytime slower, do you know how to fix this?

for a = 0,10 do
	Part.CFrame = Part.CFrame:Lerp(Nodes["Node" ..i].CFrame,a/10)
	wait(Time/10)
end