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

Why is the output saying "Unable to cast to dictonary" in my tween??

Asked by 4 years ago

Code:

--<--->--
local Player = game.Players.LocalPlayer or game.Players.PlayerAdded
local Anim_Playing = Player.Backpack.Shop:WaitForChild("Anim_Playing")
local Update_Cam = game.ReplicatedStorage.Shop_Scripts.Update_Cam
local Shop_Cam = workspace.Shop.Shop_Cam
local Button = script.Parent
--Tween Info--
local TweenService = game:GetService("TweenService")
local tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Quint,Enum.EasingDirection.Out,0,false,0.3)
local TweenProperties = {Vector3.new(599.83, 0.5, 144.61)}
--Variables--
Button.Activated:Connect(function()
    if Anim_Playing.Value == false then
    local Tween= TweenService:Create(Shop_Cam,tweeninfo,TweenProperties)
    Tween:Play()
    end
end)

1 answer

Log in to vote
0
Answered by 4 years ago

It needs a dictionary. This means you pass in a table where the keys are strings instead of ints.

I'm assuming by the fact you're using a Vector3 that it's going to be position, so you can just change line 10 to

local TweenProperties = {Position = Vector3.new(599.83, 0.5, 144.61)}
1
Thank you! now i know next time. Unscriptablee 20 — 4y
Ad

Answer this question