Just so you know, doing this will not work, because setting the primary part’s position only changes the primary part’s position.
You should to use this method (albeit outdated), because it would take significantly longer to rig the train.
@Edison20020216, here’s some food for thought.
local TweenService = game:GetService("TweenService")
local CFrameValue = Instance.new("CFrameValue")
CFrameValue.Value = Train:GetPrimaryPartCFrame()
local tween = TweenService:CreateTween(CFrameValue, TweenInfo.new(10, Enum.EasingStyle.Linear), {Value = endCFrame}) -- make sure to define endCFrame
CFrameValue.Changed:Connect(function()
Train:SetPrimaryPartCFrame(CFrameValue.Value)
end)
tween:Play()
tween.Completed:Wait()
CFrameValue:Destroy() -- does garbage collection for changed on destroy
If you don’t feel comfortable using this method, then you can use the more updated version of @PostApproval’s model tweening method: