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

Why is this tweening showing unable to cast dictionary error?

Asked by 3 years ago
Edited 3 years ago

The script I have written isn't functioning as needed. When I run the game an error appears in line 6 saying unable to cast dictionary error.

anf = script.Parent.ViewportFrame.Folder
Goals = {} 

Goals.CFrame = CFrame.new(-1017.90277, 1.26408625, -1022.59729)
info = TweenInfo.new(0.3,Enum.EasingStyle.Sine,Enum.EasingDirection.In,0,false,0)
tween = TS:Create(anf.Top, Goalsl, info)

tween:Play()

2 answers

Log in to vote
1
Answered by
imKirda 4491 Moderation Voter Community Moderator
3 years ago

TweenInfo must be the second parameter of TweenService:Create and property table third, you also made a typo, "Goalsl" should be "Goals":

local tween = TS:Create(anf.Top, info, Goals)

It's good to put local before variables to localize them and improve performance.

Ad
Log in to vote
1
Answered by
BashGuy10 384 Moderation Voter
3 years ago

Well, its a simple typo you made.

On line six, 2nd parameter of TS:Create(), you used Goals1, instead of Goals[1]

Answer this question