Moving parts and their children with TweenService

I am trying to tween multiple parts together by moving one “base” part and using WeldConstraints to “attach” the other parts to the base part.

Currently, the base part is moving as scripted but the welded parts are staying in place.

I have fiddled with anchors and the welds but nothing I have tried so far has worked. Based on a little bit of research I keep finding that the main part should be anchored and the others should not but again, not seeming to work. Here is a screenshot of the parts (one part/weld selected, larger grey part is the one moving):
image

Here is the script that moves the base part

local start = script.Parent.Parent.start
local finish = script.Parent.Parent.finish
local basePart = script.Parent.Parent.basePart
local tweenService = game:GetService("TweenService")

local time = 4

local tweenRight = TweenInfo.new(
	time,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.InOut,
	0,
	false,
	0
)
local tweenLeft = TweenInfo.new(
	time,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.InOut,
	0,
	false,
	0
)
local left = tweenService:Create(basePart, tweenLeft, {Position = start.Position})
local right = tweenService:Create(basePart, tweenRight, {Position = finish.Position})


while true do
	left:Play()
	wait(time)
	right:Play()
	wait(time)
	
end
1 Like

The additional parts do need to be unanchored, however you should also be tweening the CFrame, not the position.

Just to clarify, do I need to tween all the parts or just the main one?

You should only have to tween the main one

And should I tween the Cframe and position, or switch to Cframe? Thanks!

You should only have to tween the CFrame, the position can be removed

Sweet, it’s working great. ThankYou!

1 Like