How is this true : part1.CFrame * C1 == Part0.CFrame * C0

Can someone explain how this formula

part1.CFrame * C1 == Part0.CFrame * C0

is true as I don’t see how it is. For example if you think about it logically you have two parts (part1 and part 2) having their own positions then you add to their positions what you want to move it by (C0 and C1) I don’t see how these are equal to eachother.

The weld forces one of the parts to move in order make the equation true.

The part that is not the root part or furthest away from it is the one that gets moved.

1 Like

ooh ok so when assigning part0 and part1, part1 moves to part0 (the root) to have the same position, this is what makes this equation true?

Usually, but keep in mind Part0 is not always the root part the rules are vague though you can search it online and control it through root priority number or size.

1 Like

A weld contains an offset from one part, to another. Generally speaking, this is done relative from one part to another. E.g. “Part1 is 5 studs above Part0”. That is what the definition of a C0 is: It’s Part1’s offset from Part0. C1 is the opposite, Part0’s offset from Part1.

So if we had a weld connecting two parts, Part0, the first part, is 5 studs below Part1, the second part. You can also say Part1, the second part, is 5 studs above Part0, the first part.

When you multiply part1’s cframe by its offset from part0, you get part0’s cframe obviously. The same is true is when you multiply part0’s cframe by its offset from part1, you get part1’s cframe. That’s why they’re equal. Think of it, simplified, as so:

Weld.Part0.Position = Vector3.new(0,0,0)
Weld.Part1.Position = Vector3.new(0,3,0)
Weld.C0 = Vector3.new(0, 3, 0)
Weld.C1 = Vector3.new(0, -3, 0)

position1 = Weld.Part0.Position + Weld.C0 --this is just (0,0,0) + (0,3,0) = (0,3,0) which is part1's position
position2 = Weld.Part1.Position + Weld.C1 --this is just (0,3,0) + (0,-3,0) = (0,0,0) which is part0's position

(The above example uses Vector3s, real welds use CFrames, a combination of rotational and positional data which complicates it more)

1 Like

Would this also be the same for Motor6D? This is basically the reason why I’m tryna learn about c0 and c1 as i see these values from motor6D used a lot in code written by other people and I’m tryna to figure it out

Yes. Motor6Ds use a similar system, but they also have a transform property which is an offset of the offset used for animating

1 Like

offset of the offset? Is this the offset for the c0 and c1 values? I’m confused

Yes, so its an offset from Part0.CFrame * C0 or Part1.CFrame * C1
E.g, lets say your part0 was at 0,0,0 and a C0 of 0,3,0 so part1 is at 0,3,0, but then you had a transform of 1,0,0 so part1’s new cframe is 1,3,0

1 Like