Tween.Completed never fires even after the tween is finished

Just a guess but try replacing _ with an actual variable name like index

-- parts are the parts being tweened, and positions and orientations are their target position and orientation respectively
for i, part in parts do
	local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)
	local tween = tweenService:Create(part, tweenInfo, {Position = positions[i], Orientation = orientations[i], Transparency = 0})
	print('started tween...')
	tween:Play()
	tween.Completed:Connect(function()
		part.CanCollide = true
		part.Velocity = part.CFrame:VectorToWorldSpace(Vector3.new(0,0,12)) -- cuz it breaks the conveyors
		print('dunzo bunzo')
	end)
end

once again, this isn’t the issue

Doing it on my end with filler values works fine, I would assume it’s something else in the script or another script

local tweenService = game:GetService("TweenService")
local positions = {
	[1] = Vector3.new(0,0,0)
}
local orientations = {
	[1] = Vector3.new(0,90,0)
}
local parts = {
	[1] = workspace.Cashier.Head
}
for i, part in parts do
	local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)
	local tween = tweenService:Create(part, tweenInfo, {Position = positions[i], Orientation = orientations[i], Transparency = 0})
	print('started tween...')
	tween:Play()
	tween.Completed:Connect(function()
		part.CanCollide = true
		part.Velocity = part.CFrame:VectorToWorldSpace(Vector3.new(0,0,12)) -- cuz it breaks the conveyors
		print('dunzo bunzo')
	end)
end

Screenshot 2024-05-30 190243

i just realized
i am actually genuinely so stupid

i was deleting the parent of the script. so that caused the rest to not execute.

i am so sorry for wasting everybody’s time, i just wasn’t thinking it through very logically

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.