How to move welded part?

Hi,
I have problem, that I have got building system, that weld parts together, and I need to edit one parts position (via script), but not move with other parts. How to do it?

Easiest thing to do is remove the weld, and then recreate it.

Creating a weld in code is a little tricky:

local Weld = Instance.new("Weld")
Weld.Part0 = part0
Weld.Part1 = part1
Weld.C1 =    part0.CFrame:inverse() * part1.CFrame 
Weld.Parent = part1

Hope that helps!

4 Likes

And cant I just edit C1 and C0?

2 Likes

You can! But I actually think you only need to edit C1 using the math I posted, if you leave C0 as default.

3 Likes