Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you weld an object to an object but keep them independent?

Asked by
0te 35
4 years ago

The code below shows a part welded to the humanoid root part

function Weld(part, root)
    local weld = Instance.new("Weld", game.JointsService);
    weld.C1 = part.CFrame:toObjectSpace(root.CFrame)
    weld.Part0 = root
    weld.Part1 = part
end

The problem is however, if I applied a rotation to the part, the character will also rotate because both objects are welded together.

The reason I tried welding in the first place was because otherwise the part would just fall out of the character but I want to keep it in the humanoid root part at all times.

However, I'm trying to get the part to rotate independently without affecting the character.

Please can someone point me in the right direction in to which method I should use.

0
Well my personal thing to do is to use a BallSocketConstraint set radius to 0 it acts like a Free Weld, stays there but can freely rotate, maybe add a bodygyro too CrazyCats84 154 — 4y

Answer this question