Problem with Tweening

Hello there, for some reason it says unable to cast to dictionary:
UnableToCashToDictionary

This hasn’t happened before and I don’t know why is it happening now. I tried some other things that can possibly fix it, but it didn’t work. I’ll show you the code.

CODE:

local TweenService = game:GetService("TweenService")
local part = script.Parent

local info = TweenInfo.new(
	2,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out,
	0,
	false,
	3
)

local goal = {
	part.Size == Vector3.new(20,1,16)
}

local Tween = TweenService:Create(part, info, goal)

Tween:Play()

Can someone please fix this?

im pretty sure its to do with you using double equal signs, shouldnt it just be 1 if ur assigining

the properties for the tween which in your case is goal needs to be set out in a specific way

if you want to tween the size you would do {Size = (Size you want)}

That wouldn’t work, it has to be 2 equal signs or else it will break the script.

2 equal signs is a comparison operator. Not an assignment operator.

why? 2 equal signs is for comparing

Oh yeah I forgot, I thought it was supposed to be {part.Size = Vector3.new(16,1,20)}

also you have to do an index in the goal table instead of part.size just do Size, if u want automatic autocomplete u can type set it by doing local goal :Part = {}
goal.Size = etc

for example

local goal = { Size = Vector3.New(10,10,10) }

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.