I am trying to make my game intro and everything is fine, no errors, but there is one thing that wont work, the Tweenservice.
local function StartAnimation()
local LoadingUI = script.Parent:WaitForChild("Storage"):WaitForChild("Loading"):Clone()
LoadingUI.Parent = game.Players.LocalPlayer.PlayerGui
LoadingUI.Enabled = true
wait(2)
LoadingUI.Bg.Holder.Btn.Main:TweenSize(UDim2.new(LoadingUI.Bg.Holder.Btn.Needed.Size),'In','Quad',2);
task.wait()
for i = 0, 50, 1 do
for _, dec in pairs(LoadingUI:GetDescendants()) do
if typeof(dec) == 'Instance' and dec:IsA("GuiObject") then
dec.Transparency += 0.05
end
end
end
LoadingUI.Enabled = false
LoadingUI:Destroy()
script.Parent.Parent.Parent.Client.Values.Main.HasLoaded.Value = true
end
StartAnimation()
Basically, I will join and the TweenService does not even start. Not even the fading will work at the end. It just cuts short. I added a task.wait() and wait(2) too see if it would work, nothing changed.
local function StartAnimation()
local LoadingUI = script.Parent:WaitForChild("Storage"):WaitForChild("Loading"):Clone()
LoadingUI.Parent = game.Players.LocalPlayer.PlayerGui
LoadingUI.Enabled = true
wait(2)
LoadingUI.Bg.Holder.Btn.Main:TweenSize(LoadingUI.Bg.Holder.Btn.Needed.Size,'In','Quad',2);
task.wait()
for i = 0, 50, 1 do
for _, dec in pairs(LoadingUI:GetDescendants()) do
if typeof(dec) == 'Instance' and dec:IsA("GuiObject") then
dec.Transparency += 0.05
end
end
end
LoadingUI.Enabled = false
LoadingUI:Destroy()
script.Parent.Parent.Parent.Client.Values.Main.HasLoaded.Value = true
end
StartAnimation()
you wrote : Udim2.new(LoadingUI.Bg.Holder.Btn.Needed.Size)