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
 

Re: #################################

Previous Thread :: Next Thread 
IndustrialOrc is not online. IndustrialOrc
Joined: 10 Sep 2016
Total Posts: 327
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 is not online. Famicorn
Joined: 17 Sep 2010
Total Posts: 2421
12 Sep 2016 06:25 PM
GOOD POST


nya
nye
nyo
nyee nyo
Report Abuse
IndustrialOrc is not online. IndustrialOrc
Joined: 10 Sep 2016
Total Posts: 327
12 Sep 2016 06:26 PM
they all go to the same place :(
Report Abuse
CodeBreadpudding is not online. CodeBreadpudding
Joined: 24 Aug 2016
Total Posts: 1286
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
IndustrialOrc is not online. IndustrialOrc
Joined: 10 Sep 2016
Total Posts: 327
12 Sep 2016 06:42 PM
@Code

Obviously you are mentally impaired, because I set the C1.
Report Abuse
CodeBreadpudding is not online. CodeBreadpudding
Joined: 24 Aug 2016
Total Posts: 1286
12 Sep 2016 07:32 PM
Look what you set it to.
Report Abuse
Casualist is not online. 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
IndustrialOrc is not online. IndustrialOrc
Joined: 10 Sep 2016
Total Posts: 327
12 Sep 2016 08:25 PM
@Code
Your dumb.

@Cas
Thanks.
Report Abuse
Casualist is not online. 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 is not online. 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
IndustrialOrc is not online. IndustrialOrc
Joined: 10 Sep 2016
Total Posts: 327
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 is not online. 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
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