generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

what, exactly, are C0 and C1 for welds?

Previous Thread :: Next Thread 
coldcoldice is not online. coldcoldice
Joined: 06 Jan 2014
Total Posts: 120
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
pinballboy7 is not online. pinballboy7
Joined: 12 Mar 2009
Total Posts: 1485
06 Jan 2016 12:21 AM
Offsets of the weld.
Report Abuse
HarrySnotte is not online. HarrySnotte
Joined: 27 Jun 2011
Total Posts: 2854
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 is not online. 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 is not online. 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
ChiefTitan is not online. ChiefTitan
Joined: 03 Dec 2015
Total Posts: 2242
06 Jan 2016 07:31 AM
stefan whoever made a good video on this


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image