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: Weld Script Issue

Previous Thread :: Next Thread 
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
06 Aug 2016 11:37 AM
Hi, I'm trying to weld something to an animated zombie's torso. Although it is welded to its torso, it's not in the same position that it originally was in studio. I'm wondering if anyone has any idea how to fix this issue? I've tried numerous things, however I'm extremely new to welding and don't really know where to go from here. Any help would be appreciated, thanks.

Here's the screenshots.

a/xl2uQ


Here's the code.

char = script.Parent
test = script.Parent.test --The green brick that is welded to torso
w1 = Instance.new("Weld", char)
w1.Part0 = test
w1.Part1 = w1.Parent.Torso
w1.C1 = CFrame.fromEulerAnglesXYZ(-14.6, 3.4, -10.8) --Position of green brick

Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
06 Aug 2016 11:56 AM
Bump1.
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
06 Aug 2016 12:17 PM
Bump2.
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
06 Aug 2016 01:05 PM
Bump3.
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
06 Aug 2016 02:03 PM
Bump4.
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
06 Aug 2016 02:34 PM
Bump5.
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
06 Aug 2016 03:59 PM
Bump6..
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
06 Aug 2016 03:59 PM
parent the weld at the end, not when you just create it
Report Abuse
Marienus is not online. Marienus
Joined: 02 Jul 2012
Total Posts: 118
06 Aug 2016 04:06 PM
That^

Also, the C1 should be the position relative to the position of Part0, not just the position in workspace.

If the C1 was CFrame.new(0,1,0) Part1 would be one stud above Part0.
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
06 Aug 2016 04:11 PM
@AgressiveCatch

I did that, and it just returned with an error.

char = script.Parent
test = script.Parent.test --The green brick that is welded to torso
w1 = Instance.new("Weld")
w1.Part0 = test
w1.Part1 = w1.Parent.Torso
w1.C1 = CFrame.fromEulerAnglesXYZ(-14.6, 3.4, -10.8) --Position of green brick
w1.Parent = script.Parent
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
06 Aug 2016 04:16 PM
@Marienus

I've probably got it wrong, but I tried it and it basically made it go far away from the torso.

char = script.Parent
test = script.Parent.test --The green brick that is welded to torso
w1 = Instance.new("Weld", char)
w1.Part0 = test
w1.Part1 = w1.Parent.Torso
w1.C1 = test.CFrame
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
06 Aug 2016 04:16 PM
"w1.Parent = script.Parent"

the weld must be parented to the Part0
Report Abuse
Marienus is not online. Marienus
Joined: 02 Jul 2012
Total Posts: 118
06 Aug 2016 04:25 PM
The C1 is the part's offset from the part it is welded to. Try to fill in CFrame.new(0,0,0) in the C1 and you will understand what it does.
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
06 Aug 2016 04:44 PM
@AggressiveCatch

Tried that, didn't work.

char = script.Parent
test = script.Parent.test
w1 = Instance.new("Weld", char)
w1.Part0 = test
w1.Part1 = w1.Parent.Torso
w1.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0)
w1.Parent = w1.Part0
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
06 Aug 2016 04:52 PM
@Marienus

I understand what that part does, but it just puts it in the wrong rotation, and I don't really know how to put it in the position seen in studio...

char = script.Parent
test = script.Parent.test
w1 = Instance.new("Weld", char)
w1.Part0 = test
w1.Part1 = w1.Parent.Torso
w1.C1 = CFrame.new(5, 5, 5)
w1.Parent = w1.Part0
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
06 Aug 2016 05:14 PM
Bump7.
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
06 Aug 2016 05:22 PM
EulerAngles = regular Rotation angles

The C0 should be Part0.CFrame:inverse() * Part1.CFrame

The reason why is because then the C1 will be CFrame.new()

Meaning you can manipulate it much easier without having any problems.
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
06 Aug 2016 05:55 PM
@thedailyblarg

Same problem as last time. Wrong rotation, and wrong place.

char = script.Parent
test = script.Parent.test --The green brick that is welded to torso
w1 = Instance.new("Weld", char)
w1.Part0 = test
w1.Part1 = w1.Parent.Torso
w1.C0 = test.CFrame:inverse() * w1.Part1.CFrame
w1.C1 = CFrame.new(5, 5, 5)

I just don't really know what to do.
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
06 Aug 2016 06:05 PM
It should work just fine. Try this after your code:

while wait() do
w1.C1 = CFrame.new(0,math.sin(tick()*20)*5),0)
end

This will move the part up and down. Fun! Animations with CFrame should definately be working
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
06 Aug 2016 06:06 PM
while wait() do
w1.C1 = CFrame.new(0,math.sin(tick()*20)*5,0)
end

--fixed example
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
06 Aug 2016 06:16 PM
Thank you, but how would I make the the brick stay in it's original place? Because when I open studio, it's it's rotated 90 degrees and is in the middle of the torso if I put CFrame.new(0, 0, 0).
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
06 Aug 2016 06:17 PM
Anchor the things you are welding before unanchoring
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
06 Aug 2016 06:23 PM
Thank you so much! It works!
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