Unable to cast to Dictionary?

I’m trying to Tween parts all together, but every time the tween plays, I get this error.

image

Code:

local Children = script.Parent.Model:GetChildren()
local TS = game:GetService("TweenService")

while true do
	for _, Part in pairs(Children) do
		if Part:IsA("Part") then
			local GO = Vector3.new(514,Part.Position.Y,Part.Position.Z)
			print("aaa")
			local TI  = TweenInfo.new(20)
			local TW = TS:Create(Part,TI,GO)
			TW:Play()
		end
	end
	wait(19)
	for _, Part in pairs(Children) do
		Part.Position = Part.Position + Vector3.new(-514,0,0)
		end
end

I’m not sure what’s causing the error, I’m pretty sure I wrote everything correctly.

1 Like

Change this

local TW = TS:Create(Part,TI,GO)

To this

local TW = TS:Create(Part,TI,{Position = GO})

The goal part of a tween needs the brackets of information of what it’s tweening

3 Likes

That’s changed the error to this.
image

Oops, Change the Vector3 to Position. What it’s doing is looking for a value called “vector3” but It seems like you want to tween position.

1 Like

That worked perfectly, thanks for the help!

1 Like