G0odby3
|
  |
| Joined: 26 Jan 2016 |
| Total Posts: 5587 |
|
|
| 15 Feb 2016 01:27 PM |
13:26:43.321 - Auto-Saving... 13:26:44.906 - std::bad_cast 13:26:44.907 - Script 'ServerScriptService.Script', Line 8 - global MakeJoint 13:26:44.907 - Script 'ServerScriptService.Script', Line 12 13:26:44.908 - Stack End
I'm trying to make a rag doll, here's the script...
local dummy = workspace.Dummy
function MakeJoint(p0, p1, name) local glue = Instance.new("Glue", p0) glue.Parent= p0 glue.Name = name glue.Part0 = p0 glue.Part1 = p1 end
for i,v in next, dummy:GetChildren() do MakeJoint(dummy.Torso, v, "TorsoTo"..v.Name) end
|
|
|
| Report Abuse |
|
|
|
| 15 Feb 2016 01:28 PM |
You can't weld a part to itself. Check if the part equals itself before proceeding.
|
|
|
| Report Abuse |
|
|
G0odby3
|
  |
| Joined: 26 Jan 2016 |
| Total Posts: 5587 |
|
|
| 15 Feb 2016 01:30 PM |
Ah... it was also the humanoid I put inside of the dummy... Silly me.
But now it just clumps into a ball as shown here: https://gyazo.com/e75ec6070309e3399e7af58a98f74f76
|
|
|
| Report Abuse |
|
|
|
| 15 Feb 2016 01:30 PM |
You need to set C0 and C1 as well, or it would clump like that.
http://wiki.roblox.com/index.php?title=Joint#Programmatic_Creation
|
|
|
| Report Abuse |
|
|
G0odby3
|
  |
| Joined: 26 Jan 2016 |
| Total Posts: 5587 |
|
|
| 15 Feb 2016 01:32 PM |
I don't think I'll ever understand 3D positioning...
|
|
|
| Report Abuse |
|
|
G0odby3
|
  |
| Joined: 26 Jan 2016 |
| Total Posts: 5587 |
|
|
| 15 Feb 2016 01:43 PM |
Well now it's just being really weird...
Here's a GIF
https://gyazo.com/cc83d4416dc8993d12c5ef3faf3bc151
|
|
|
| Report Abuse |
|
|
|
| 15 Feb 2016 01:49 PM |
| You aren't setting C0 or C1 correctly. |
|
|
| Report Abuse |
|
|
G0odby3
|
  |
| Joined: 26 Jan 2016 |
| Total Posts: 5587 |
|
|
| 15 Feb 2016 01:52 PM |
local dummy = workspace.Dummy
function MakeJoint(p0, p1, name) local glue = Instance.new("Glue", p0) glue.Parent= p0 glue.Name = name glue.Part0 = p0 glue.Part1 = p1 glue.C0 = CFrame.new() glue.C1 = p1.CFrame:toObjectSpace(p0.CFrame) end
for i,v in next, dummy:GetChildren() do if v:IsA("Part") and v.Name ~= "Torso" then MakeJoint(dummy.Torso, v, "TorsoTo"..v.Name) end end
|
|
|
| Report Abuse |
|
|
G0odby3
|
  |
| Joined: 26 Jan 2016 |
| Total Posts: 5587 |
|
|
| 15 Feb 2016 01:55 PM |
Ugh... I switched the C0 and C1 and it looked normal at first but then it freaked out, shown here: https://gyazo.com/4520b0212e39a2c10e16b5eecb47e1a7
|
|
|
| Report Abuse |
|
|
G0odby3
|
  |
| Joined: 26 Jan 2016 |
| Total Posts: 5587 |
|
|
| 15 Feb 2016 02:07 PM |
I wanna make a ragdoll like they do in this game: http://www.roblox.com/games/6597705/Chaos-Washers
|
|
|
| Report Abuse |
|
|
G0odby3
|
  |
| Joined: 26 Jan 2016 |
| Total Posts: 5587 |
|
|
| 15 Feb 2016 02:16 PM |
Especially the toggle function. How2
|
|
|
| Report Abuse |
|
|