Skinned Mesh Ragdoll [Recategorized]

Sure ragdolls are cool with R15 and R6 but whats even cooler is a skinned mesh ragdoll. Now I could make it by hand but whats the fun in that. My goal is to make a automatic ragdoll script for mesh deformation characters.
https://gyazo.com/d916f3509e5e79a6e487ba00ca8fb277 - This is my current status on how far I’ve gotten

local Dummy = game.Workspace.Test.Cube.spine:GetDescendants()

for i, v in pairs(Dummy) do
	local Part1 = Instance.new("Part")
	Part1.Name = v.Name.."_Part1"
	Part1.Size = Vector3.new(0.1,0.1,0.1)
	Part1.Position = v.WorldPosition
	Part1.CanCollide = true
	Part1.Anchored = false
	Part1.Transparency = 1
	
	local Part2 = Instance.new("Part")
	Part2.Name = v.Name.."_Part2"
	Part2.Size = Vector3.new(0.1,0.1,0.1)
	Part2.Position = v.WorldPosition
	Part2.CanCollide = true
	Part2.Anchored = false
	Part2.Transparency = 1
	
	Part1.Parent = v
	Part2.Parent = v
	
	local Att1 = Instance.new("Attachment")
	Att1.WorldPosition = Part1.Position
	Att1.Parent = Part1
	
	local Att2 = Instance.new("Attachment")
	Att2.WorldPosition = Part2.Position
	Att2.Parent = Part2
	
	local Rope = Instance.new("RodConstraint")
	Rope.Attachment0 = Att1
	Rope.Attachment1 = Att2
	Rope.Length = Rope.CurrentDistance
	Rope.Visible = true
	Rope.Parent = v
	
	Part1.Changed:Connect(function(Changed)
		v.WorldPosition = Part1.Position
	end)
	
	Part2.Changed:Connect(function(Changed)
		v.WorldPosition = Part2.Position
	end)
end

I have no idea what to do in order to fix whatever this dummy is doing

1 Like

Code Review is for improving code that already works. For code that doesn’t work or for help troubleshooting issues with your code, please use the Scripting Support category.

Recategorised.

2 Likes