Tween does not work on a model with welded parts

Hi, I want to tween a model but it doesn’t work. I welded all the parts in the model and only the mainpart is anchored.

When I test it, it only tweens the mainpart and the other parts of the model do not.

Script:

local TweenService = game:GetService("TweenService")
local ElevatorIsMoving = false
local ElevatorFloor = 1
local tweenInfo = TweenInfo.new(10, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)
local Tween1 = TweenService:Create(script.Parent.MainPart, tweenInfo, {Position = Vector3.new(1.6, 90.4, 21.1)})
local Tween2 = TweenService:Create(script.Parent.MainPart, tweenInfo, {Position = Vector3.new(1.6, 2.2, 21.1)})

script.Parent.PartMoveElevator.ClickDetector.MouseClick:Connect(function()
	if not ElevatorIsMoving and ElevatorFloor == 1 then
		ElevatorIsMoving = true
		ElevatorFloor = 2
		script.Parent.DoorRight.Transparency = 0
		script.Parent.DoorRight.CanCollide = true
		script.Parent.PartMoveElevator.Material = Enum.Material.Neon
		Tween1:Play()
	end
end)

Are you using a weld constraint? If so then that’s the issue since the connected parts don’t move if position is being set, try using CFrames, or you can use a weld instance for your model.

1 Like

What’s the difference between constraint and the Instance?

Oh weld constraints have this special rule I mentioned that allows it to be repositioned which is breaking the current script I believe. Weld instances dont.

So if I move a part that is connected to another part with a weld instance, it breaks? And if it’s a constraint, it doesn’t?

Yes, I am using a weld constraint and I did what you said and it worked, thanks for your help!