Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

TweenService Unable to cast to Dictionary error?

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

✓ Accepted answer

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.

1 comment

0

Thank you so much!!

This discussion is preserved as it was. New answers, comments, and votes are closed.