I'm trying to make a simple loading screen for when a player joins. The loading screen has a simple animation that makes the loading text fade in and fade out by tweening it but it doesn't work.

This is the code I'm using right now:

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All,false)

local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild('PlayerGui')
local tweenService = game:GetService("TweenService")

local screen = script:WaitForChild('LoadingScreen'):Clone()
screen.Parent = playerGui
game.ReplicatedFirst:RemoveDefaultLoadingScreen()
local test = false

function loadingAnim()
	local loadText = screen.Frame.Loading
	local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
	wait(2)
	local goal = {TextColor3 = Color3.new(1, 1, 1)}
	tweenService:Create(loadText, tweenInfo, goal)
	wait(2)
	local goal = {TextColor3 = Color3.new(0, 0, 0)}
	tweenService:Create(loadText, tweenInfo, goal)
	wait(2)
end

repeat loadingAnim() until test == true

I tried tweening the transparency first but since that wasn't working I tried to tween the colors but it doesn't work either. There are no errors appearing in the output so I really don't know what's going on. Can anyone help?

1 comment

0

Try using the "print()" tactic.Put a print everyone and label it and see where it goes up to. Then tell us near where the problem seems to be occuring