|
| 06 Jan 2016 12:13 AM |
i haven't been able to find any really coherent descriptions of what C0 and C1 are, and how to use them in welding properly
|
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Jan 2016 02:10 AM |
| I never actually used C1, because I never needed it. C0 however, is the relative CFrame of Part1 compared to Part0. So imagine that the CFrame of Part0 is the CFrame of the axis-origin(this would have this CFrame: CFrame.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), C0 would be the CFrame compared to that CFrame instead of the real axis-origin. I don't really know how to explain this, certainly not in english lol. |
|
|
| Report Abuse |
|
|
AkaLua
|
  |
| Joined: 27 Jul 2012 |
| Total Posts: 526 |
|
|
| 06 Jan 2016 02:13 AM |
Auto welding 2 parts
local weld = Instance.new("Weld") weld.Part0 = game.Workspace.Part0 weld.Part1 = game.Workspace.Part1 weld.C0 = game.Workspace.Part0.CFrame:inverse() weld.C1 = game.Workspace.Part1.CFrame:inverse() weld.Parent = game.Workspace.Part0
It gives the weld an offset. Without this the parts would teleport to inside each other once you've welded them.
-____________________________- |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 06 Jan 2016 02:15 AM |
With welds, you don't have to really worry about C1 (although technically you can use C1 and not C0). This equation (comes from the wiki): Part1.CFrame * C1 == Part0.CFrame * C0
Makes much more sense when you don't have to worry about C1 (it being a "blank" cframe). C0 is really just how far the "offset point" is from Part0, meaning if it's (5, 0, 0), the offset point will be 5 studs right relative to part0.
Part1.CFrame = Part0.CFrame * C0
Part1's CFrame is just Part0's CFrame multiplied by C0, so a very typical example might be to just weld your arm 2 studs right of your torso:
local w = Instance.new("Weld", torso) w.Part0 = torso w.Part1 = rightArm w.C0 = CFrame.new(2, 0, 0) |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2016 07:31 AM |
stefan whoever made a good video on this
|
|
|
| Report Abuse |
|
|