My 2nd tween doesn't work

So right now I’m looping through a table of parts in my workspace, I want to similtaenously do a tween where it goes up and another that goes down, Like a hovering effect.

Right now the problem is it only animates the first tween, if I use tween.Completed, it yields my for i,v pairs loop and it doesn’t make the parts animate at the same time.

I have tried to put the tweening into diffrent functions and calling them from the i,v loop but still same problem

local tweenService = game:GetService("TweenService")


local function getParts()
	local allParts = {}
	local folder = game.Workspace:WaitForChild("Folder")
	for i,v in pairs(folder:GetChildren()) do 
		table.insert(allParts, v)
	return allParts


local part = getParts()
local Time = 5
local tweenInfo =, Enum.EasingStyle.Linear, Enum.EasingDirection.In, -1 )

local function up(part)
	local newPos =, 1, 0)
	local tween = tweenService:Create(part, tweenInfo, {CFrame = part.CFrame * newPos})

local function down(part)
	local endPos =, -1, 0)
	local tween2 = tweenService:Create(part, tweenInfo, {CFrame = part.CFrame * endPos})

local function animations(part, Time, Dist, bool)
	--local tweenInfo =, Enum.EasingStyle.Linear, Enum.EasingDirection.In, -1 )
	for i,v in pairs(part) do 
		--local newPos =, 1, 0)
		--local endPos =, -1, 0)
		--local tween = tweenService:Create(v, tweenInfo, {CFrame = v.CFrame * endPos})
		--local tween2 = tweenService:Create(v, tweenInfo, {CFrame = v.CFrame * newPos})

animations(part, Time)

TweenInfo has a boolean reverse property, you could possibly use that instead.

If not, you’ll need to make it synchronous by Waiting on Completed but have the repeat loop as 0 since this’ll let it continue, overriding the down Tween. Furthermore, a Coroutined while loop will be needed in order to make it repeat.


I’m not sure how to use the reverse property, I get a error saying that reverses can’t be assigned to

local tweenInfo =, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 2)
tweenInfo.Reverses = true 

local info =, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0 true)

You need to pass it as an argument right there rather than change it separately, kind of like changing a Udim2’s X.Scale in the constructor function rather than overwriting the current scale separately.

1 Like

thanks everyone It works now :slight_smile: :slight_smile: :slight_smile: