So, I have a simple script that tweens a GUI frame's background color. For some reason I get an error saying the tween was unable to be cast. Here's my script:
local TweenService = game:GetService("TweenService") local LoadingScreenGui = script.Parent local Background = LoadingScreenGui:WaitForChild("Background") local TransitionTime = 1 function TweenObject(object,goal,t) local tweenInfo = TweenInfo.new(1) print(type(object),type(goal),type(tweenInfo)) local tween = TweenService:Create(object,goal,tweenInfo) tween:Play() end local goal = {} goal.BackgroundColor3 = Color3.new(1,1,1) TweenObject(Background,goal,TransitionTime)
I could really use some help with this.
In line 11, you set the goal table to blank.
local goal = { BackgroundColor3 = Color3.fromRGB(r, g, b) }
Set the r g b to your colours.