Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Unable to cast tween to dictionary error while tweening?

Asked by 5 years ago
Edited 5 years ago

So I'm doing a simple tween of a GUI frames background transparency. Heres the code:

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)
    local tween = TweenService:Create(object,goal,tweenInfo)
    tween:Play()
end
local goal = {}
goal.BackgroundTransparency = 1
print(goal.BackgroundTransparency)
TweenObject(Background,goal,TransitionTime)

Here's the error I get are when the script is ran:

13:52:10.102 - Unable to cast to Dictionary
13:52:10.102 - Stack Begin
13:52:10.103 - Script 'Players.wafflecow321.PlayerGui.LoadingGui.LoadingSequence', Line 9 - global TweenObject
13:52:10.103 - Script 'Players.wafflecow321.PlayerGui.LoadingGui.LoadingSequence', Line 15
13:52:10.104 - Stack End

I'm like 80% certain none of the values I put into the tween create function are malformed, but I don't know. Any help would be appreciated.

0
You're not passing tweenInfo as an argument to Create() Amiaa16 3227 — 5y
0
yup im dumb Wafflecow321 457 — 5y
0
Oh I'm still getting the error. Wafflecow321 457 — 5y

Answer this question