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

TweenService Unable to cast to Dictionary error?

Asked by 4 years ago

I am trying to tween the camera and I get the error:

14:19:02.083 - Unable to cast to Dictionary
14:19:02.084 - Stack Begin
14:19:02.084 - Script 'Players.parker02311.PlayerGui.bookingSGUI.bookingHandler', Line 111
14:19:02.085 - Stack End

My code is

cam.CameraType = Enum.CameraType.Scriptable
local TI = TweenInfo.new(5, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
local Goal = CFrame.new(game.Workspace.Screen1Cam.Position)
local Animation = tween:Create(cam, TI, Goal)
Animation:Play()

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

You need to create a dictionary, like Goal = {CFrame = CFrame.new(game.Workspace.Screen1Cam.Position)}.

You can make a dictionary of every property you want to tween, and TweenService needs to know which property to set to the value, which is why you use a dictionary.

0
Thank you so much!! parker02311 27 — 4y
Ad

Answer this question