Cloned ragdoll body spasming out?

Hello, I wanted to know why a cloned ragdoll body was spasming out whenever killed.
GIF (Gyazo)
Here’s my script: (PLACED IN STARTER CHARACTER SCRIPT)

local designatedHMANOID=script.Parent:WaitForChild("Humanoid")
designatedHMANOID.BreakJointsOnDeath=false
designatedHMANOID.Died:Connect(function()
	script.Parent.Archivable=true
	local cloneRagdoll = script.Parent:Clone()
	
	for index,joint in pairs(cloneRagdoll:GetDescendants()) do
		if joint:IsA("Motor6D") then
			local socket = Instance.new("BallSocketConstraint")
			local a1= Instance.new("Attachment")
			local a2= Instance.new("Attachment")
			a1.Parent=joint.Part0
			a2.Parent=joint.Part1
			socket.Parent=joint.Parent
			socket.Attachment0=a1
			socket.Attachment1=a2
			a1.CFrame=joint.C0
			a2.CFrame=joint.C1
			socket.LimitsEnabled=true
			socket.TwistLimitsEnabled=true
			joint:Remove()
		end
	end
	cloneRagdoll.Parent=workspace
end)

Basically what I would like to happen is that the cloned body just normally ragdolls instead of this and my original body gets deleted, hence the clone.

Yes, I did test it without the clone, and the ragdoll works on the original body.

Any help would be appreciated.

Are the cloned body parts CanCollide on?
They might fight each other if the joints are trying to get the parts too close together.
You could go to the Settings>Physics>ShowCollisions (or whatever it’s titled) to see if the Parts are interacting with each other.

Yes, they are, and in the process of verifying that I think it’s because it is still alive when cloned. It goes on ragdoll for a few seconds then it spasms out. I think that might be because the ragdoll script is active. Do you have any idea how to remove the humanoid object but not removing the player’s clothes at the same time?

Oh and the health is regenerating on the clone, how would I permanently kill him?

Removing the humanoid fixed itimage

I figured out a way by doing :
cloneRagdoll:FindFirstChild("Humanoid"):ChangeState(Enum.HumanoidStateType.Dead)

1 Like