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
|
  |
| Joined: 01 Apr 2011 |
| Total Posts: 11679 |
|
| |
|
DarkComa
|
  |
| Joined: 01 Apr 2011 |
| Total Posts: 11679 |
|
| |
|
DarkComa
|
  |
| Joined: 01 Apr 2011 |
| Total Posts: 11679 |
|
| |
|
DarkComa
|
  |
| Joined: 01 Apr 2011 |
| Total Posts: 11679 |
|
| |
|
DarkComa
|
  |
| Joined: 01 Apr 2011 |
| Total Posts: 11679 |
|
| |
|
DarkComa
|
  |
| Joined: 01 Apr 2011 |
| Total Posts: 11679 |
|
| |
|
|
| 06 Aug 2016 03:59 PM |
| parent the weld at the end, not when you just create it |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 06 Aug 2016 04:16 PM |
"w1.Parent = script.Parent"
the weld must be parented to the Part0 |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 01 Apr 2011 |
| Total Posts: 11679 |
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 06 Aug 2016 06:17 PM |
| Anchor the things you are welding before unanchoring |
|
|
| Report Abuse |
|
|
DarkComa
|
  |
| Joined: 01 Apr 2011 |
| Total Posts: 11679 |
|
|
| 06 Aug 2016 06:23 PM |
| Thank you so much! It works! |
|
|
| Report Abuse |
|
|