|
| 12 Sep 2016 06:24 PM |
:(
local Torso = Character:WaitForChild("Torso") Torso.TopSurface = Enum.SurfaceType.Weld Torso.RightSurface = Enum.SurfaceType.Weld Torso.LeftSurface = Enum.SurfaceType.Weld local AttachedCharacter = BaseCharacter:Clone() AttachedCharacter.Parent = workspace local UpperTorso = AttachedCharacter:WaitForChild("UpperTorso") for Index, Object in next, AttachedCharacter:GetChildren() do local CharacterWeld = Instance.new("Weld", Torso) CharacterWeld.Name = ("Weld_UpperTorso:"..Object.Name) CharacterWeld.Part0 = UpperTorso CharacterWeld.Part1 = Object CharacterWeld.C1 = Object.CFrame:toObjectSpace(UpperTorso.CFrame) end local MainWeld = Instance.new("Weld", Torso) MainWeld.Name = "MainWeld" MainWeld.Part0 = Torso MainWeld.Part1 = UpperTorso AttachedCharacter:MakeJoints() |
|
|
| Report Abuse |
|
|
Famicorn
|
  |
| Joined: 17 Sep 2010 |
| Total Posts: 2421 |
|
|
| 12 Sep 2016 06:25 PM |
GOOD POST
nya nye nyo nyee nyo |
|
|
| Report Abuse |
|
|
|
| 12 Sep 2016 06:26 PM |
| they all go to the same place :( |
|
|
| Report Abuse |
|
|
|
| 12 Sep 2016 06:35 PM |
| You must be new to welding, if you want that parts to have a different location set a CFrame, otherwise it jams everything into one part. The CFrame is offset from Part0's Position value. |
|
|
| Report Abuse |
|
|
|
| 12 Sep 2016 06:42 PM |
@Code
Obviously you are mentally impaired, because I set the C1. |
|
|
| Report Abuse |
|
|
| |
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 12 Sep 2016 07:33 PM |
Parent last, or define C0//C1 before Part0 and Part1.
local Torso = Character:WaitForChild("Torso") Torso.TopSurface = Enum.SurfaceType.Weld Torso.RightSurface = Enum.SurfaceType.Weld Torso.LeftSurface = Enum.SurfaceType.Weld local AttachedCharacter = BaseCharacter:Clone() AttachedCharacter.Parent = workspace local UpperTorso = AttachedCharacter:WaitForChild("UpperTorso") for Index, Object in next, AttachedCharacter:GetChildren() do local CharacterWeld = Instance.new("Weld", Torso) CharacterWeld.Name = ("Weld_UpperTorso:"..Object.Name) CharacterWeld.C1 = Object.CFrame:toObjectSpace(UpperTorso.CFrame) CharacterWeld.Part0 = UpperTorso CharacterWeld.Part1 = Object end local MainWeld = Instance.new("Weld", Torso) MainWeld.Name = "MainWeld" MainWeld.Part0 = Torso MainWeld.Part1 = UpperTorso AttachedCharacter:MakeJoints() |
|
|
| Report Abuse |
|
|
|
| 12 Sep 2016 08:25 PM |
@Code Your dumb.
@Cas Thanks. |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 12 Sep 2016 08:51 PM |
| @OP No problem. It's a common enough error, but the short of it is that welds manipulate the position of Part1 relative to Part0 via the relation: Weld.Part0.CFrame*Weld.C0 == Weld.Part1.CFrame*Weld.C1 When you create a new Weld the default of ## ### ## is CFrame.new() making the above relation: Weld.Part0.CFrame*CFrame.new() == Weld.Part1.CFrame*CFrame.new() Weld.Part0.CFrame == Weld.Part1.CFrame If you define Weld.Part0, Weld.Part1, and Weld.Parent before ####### ### ####### you're going to overwrite Weld.Part1.CFrame with the above. Thus if you're going to define ###### relative ############# ### #### to do it before you parent the weld, or before define Part0//Part1 |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 12 Sep 2016 09:02 PM |
| lol, first time I've had an issue with the filter. Oh well. |
|
|
| Report Abuse |
|
|
|
| 12 Sep 2016 09:05 PM |
| Mind explaining why I had to set the C1 first? I've never had that issue before, when using constant offsets not dependant on the part, etc. |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 13 Sep 2016 12:24 AM |
@OP No problem (hopefully I can get past the filter this time). It's a common enough error, but the short of it is that welds manipulate the CFrame of Part1 relative to Part0 via the relation:
Weld.Part0.CFrame*Weld.C0 == Weld.Part1.CFrame*Weld.C1
When you create a new Weld the defaults of Weld.C0 and Weld.C1 are CFrame.new() making the above relation reduce to:
Weld.Part0.CFrame*CFrame.new() == Weld.Part1.CFrame*CFrame.new() Weld.Part0.CFrame == Weld.Part1.CFrame
Thus, if we don't define Weld.C0 and/or Weld.C1 before we define Weld.Parent, Weld.Part0, and Weld.Part1 are are essentially setting Weld.Part1's CFrame to be Weld.Part0.CFrame (because the weld is 'active' once it's parented, and Part0 and Part1 are defined).
This is only problematic if we need Part1's original CFrame to calculate Weld.C0 and/or Weld.C1.
So the fix to this is simple, either parent the weld last, or define Weld.C0 and/or Weld.C1 before defining Weld.Part0 and Weld.Part1 |
|
|
| Report Abuse |
|
|