Tween Animation Not Tweening

Hey! I’ve been having trouble recently where all of my tweens with transparency just don’t work. I do the tweening correctly, but it always just cuts to the goal. Is there something wrong with my script?

local TweenService = game:GetService("TweenService")
local newTweenInfo = TweenInfo.new(3, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0)
local newTween = TweenService:Create(script.Parent:WaitForChild("MainFrame"), newTweenInfo, {Transparency = 1})
local MainFrame = script.Parent:WaitForChild("MainFrame")
local LoadingLabel = script.Parent:WaitForChild("MainFrame"):WaitForChild("TextLabel")

local function Tween(tweenPlayed:Tween)
	
	tweenPlayed:Play()
	print("tween played")
	
end

for i = 1, 3, 1 do
	
	for i = 1, 3, 1 do
		
		LoadingLabel.Text = LoadingLabel.Text .. "."
		task.wait(0.75)
		
	end
	
	LoadingLabel.Text = "Loading"
	
end

Tween(newTween)
MainFrame.Visible = false
print("mainframe is invisible")

Thanks in advance!

not the best but i think this will work fine too

local function Tween(tweenPlayed)
	
	tweenPlayed:Play()
	print("tween played")
	
end
1 Like

It didn’t work, but I do appreciate the help

I found the problem:

Tween(newTween)
MainFrame.Visible = false

should have been

Tween(newTween)
task.wait(3)
MainFrame.Visible = false

I hate how weird roblox animation are. I can never get the times right. Sorry to bother everyone; have a good night or day!

1 Like

you can do newTween.Completed:Wait()