Tweening Model, only primary part moving

I am trying to make a ski lift follow the path. The issue is, only the primary part is following the path. The other parts are all welded using weld constraints, to the primary part. I have no idea why only the primary part is moving.

The script does seem to be functioning, but it is tweening only the primary part even though all of the other parts are welded to it AND unanchored.

As shown below, only the primary part is moving.

image

for i,v in pairs(Checkpoints:GetChildren()) do
	local NewPoint = Checkpoints:WaitForChild(i)
	CFrameTable.Position = NewPoint.Position
	local Distance = (script.Parent:FindFirstChild("Vehicle").PrimaryPart.Position - NewPoint.Position).magnitude 
	 Time = GetTime(Distance, Speed)
	print(Time)
	local NewTweenInfoTable = TweenInfo.new(
		Time, 
		Enum.EasingStyle.Linear,
		Enum.EasingDirection.Out, 
		0,
		false,
		0 
	)
	local PanelSlideTween = TweenService:Create(Vehicle.PrimaryPart, NewTweenInfoTable, CFrameTable)
	PanelSlideTween:Play()
	PanelSlideTween.Completed:wait()
	end

for anyone who stumbles across this: I eventually solved this by tweening CFrame instead :smile:

1 Like

I’ve tried to do this before too, but if I’m not mistaken, you can’t Tween a model just by moving the primary part. You can make a for loop though and use TweenService’s GetValue() Method to find where it should currently be and move it.

To tween a model, there are multiple methods. But the lazy way is creating a CFrameValue Object and tweening that object.

You then run a .Changed function on the CFrameValue and when that event is fired, and subsequently the function is run, you will use SetPrimaryPartCFrame to move the model to the CFrameValue’s value.

Though with this I believe there are some float errors involved, so if you want the perfect amazing way, follow this tutorial by the amazing colbert:

2 Likes