hello, I am trying to tween a loading screen so that while loading the there’s transparent line that goes through the image, like this:
However the script is having the error, Cannot cast value to object. Here is the script:
> local ContentProvider = game:GetService("ContentProvider")
>
> local assetsTable = game.ReplicatedStorage:GetDescendants()
> local totalAssets = #assetsTable
> local assetsLoaded = 0
> local TS = game:GetService("TweenService")
>
> local UIGRADIENT = script.Parent.Title.UIGradient
>
> task.spawn(function()
> while assetsLoaded < totalAssets do
> TS:Create(UIGRADIENT.Transparency.Keypoints[3], TweenInfo.new(.5), {Time = 0.9999}):Play()
> wait(0.5)
> TS:Create(UIGRADIENT.Transparency.Keypoints[3], TweenInfo.new(.5), {Time = 0.0001}):Play()
> wait(0.5)
> end
> end)