Can't Tween Welded Models

Hi,
Recently, I was trying to tween a model by using welds but it fails every time I try to do it.


What I tried to do is, replace Welds with WeldConstraints and Motor6Ds but that didn’t work, I also, tried to tween CFrame instead of Position but that also didn’t work. I tried to unanchor it, it works but after the first tween, it starts jumping strongly!

Code:

local tweenService = game:GetService("TweenService")

local TI = TweenInfo.new(2, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut, math.huge, true, 2)

local tween = tweenService:Create(script.Parent, TI, {CFrame = script.Parent.CFrame + Vector3.new(0,-5,0)})

tween:Play()

If you’re tweening movement, you need to tween the weld itself (Motor6D or Weld). If you tween the part it will break the weld.

Example…
(On mobile)
local goal = {C0 = C0 * CFrame.new(0,5,0)}

Then create the tween on the weld instead of the part.

1 Like

Alright, sounds good, but will that force me to tween all welds/motor6Ds or just one will be enough?

You should just weld all the parts to one basepart, then unanchor all those parts while keeping the basepart/primarypart anchored. Then tween that primarypart.

local function castWeld(x,y)
    local weld = Instance.new("Weld", x);
    weld.Part0 = x; weld.Part1 = y;
    weld.C0 = x.CFrame:Inverse(); weld.C1 = y.CFrame:Inverse();
end;
--
local function UnAnchor(model)
    for _,g in ipairs(model:GetChildren()) do
        if not g == model.PrimaryPart then
            g.Anchored = false;
        end;
    end;
end;
--
for _,b in ipairs(Model:GetChildren()) do
    if (not b == Model.PrimaryPart) then
        castWeld(b,Model.PrimaryPart);
    end;
end;
UnAnchor(Model);

--<Now tween the Anchored PrimaryPart \ All Parts Must Also Be Anchored Before Welding
1 Like

Unanchor ever part except for teh main part(the part you are tweeining). Anchored parts won’t move if they are welded.