Help with Train System (TweenService)

  1. What do you want to achieve? Am attempting to make a train system using tweenservice.

  2. What is the issue? The code throws an error “Unable to cast to dictionary”

  3. What solutions have you tried so far? Searched DevHub and scriptinghelpers.

local TweenService = game:GetService('TweenService')

local istrue = false

repeat

	
	for i, v in pairs(workspace.TrainParts.RailParts.Stops:GetChildren()) do 
		if v:IsA("Part") then
		local part = game.workspace.TrainParts.Train.TrainPart	
		local goal = {v.CFrame}
		local info = TweenInfo.new( 
			20,
			Enum.EasingStyle.Quad,   
			Enum.EasingDirection.Out,  
			0,                      
			false,                 
			0            
		)
		local Tween = TweenService:Create(part, info, goal)
		Tween:Play()
		else print("Failure is not an option")
		end
		
		
		
end
	 
	until istrue == true

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

Alright, so you got the goal incorrect, the goal is what properties you want to change. You supplied an end-CFrame without telling the game you want to change the CFrame.

To fix this, change:

local goal = {v.CFrame}

to

local goal = {CFrame = v.CFrame}