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

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

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

✓ Accepted answer

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 comment

1

Thank you! now i know next time.

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