Ragdoll instantly kills player

It’s R6. I’m pretty sure it works for both R6 and R15, though.

1 Like

the body parts fall off due to no collision parts;

what you can do is: create parts that have cancollide off when the player isn’t ragdolled, but when the player is ragdolled set them to cancollide on.

local AttactmentData = { 
	["RA"] = {"Right Arm", CFrame.new(0, 0.5, 0), CFrame.new(1.5, 0.5, 0), CFrame.new(1.5, 0, 0)},
	["LA"] = {"Left Arm", CFrame.new(0, 0.5, 0), CFrame.new(-1.5, 0.5, 0), CFrame.new(-1.5, 0, 0)},
	["RL"] = {"Right Leg", CFrame.new(0, 0.5, 0), CFrame.new(0.5, -1.5, 0), CFrame.new(0.5, -2, 0)},
	["LL"] = {"Left Leg", CFrame.new(0, 0.5, 0), CFrame.new(-0.5, -1.5, 0), CFrame.new(-0.5, -2, 0)},
}
char = script.Parent
for asefasf, data in pairs(AttactmentData) do
	local get_limb = char:FindFirstChild(data[1])
	if get_limb ~= nil then
		get_limb.CanCollide = false
		local collision_part = Instance.new("Part")
		collision_part.Name = "ColPart"
		collision_part.Size = Vector3.new(1, 1.5, 1)
		collision_part.Transparency = 1
		local colpartclone = collision_part:Clone()
		local colpartclone_weld = Instance.new("Weld")
		colpartclone_weld.C0 = CFrame.new(0, -0.25, 0)
		colpartclone_weld.Part0 = get_limb
		colpartclone_weld.Part1 = colpartclone
		colpartclone_weld.Parent = colpartclone
		colpartclone.Parent = char
	end
end

the code here creates the collisions parts; modify the code fit in ur module, and it should work.

From where I’m looking, I’m not sure how this solves the original problem.

I was able to prevent them from falling into the void by simply enabling collisions for the limbs, but the ragdoll is to work off BallSocketConstraints, which doesn’t seem to work…

If it helps, can you elaborate what the code you’ve provided does?

1 Like

i have never used ballsocketconstraints to stop limbs from falling into the void, in my life.

i have used collision parts all the time to stop them from falling off.


my code basically CREATES the collision parts in the character and sets their cframe and welds them to the limbs.

in my opinion you should either enable collisions for limbs or add collision parts, they may be ragdolls using ballsocketcontraints, however i have always used collision parts, so.

1 Like

The ballsocketconstraints are what are used to create the ragdoll, simply giving the limbs collision on ragdoll are enough to stop them from falling into the void.

Even though the limbs don’t fall into the void now, the ballsocketconstraints don’t seem to create the ragdoll.

1 Like

have you tried looking at the dev console are there any errors or anything?

1 Like

It doesn’t show any errors, and all the items that I’m looking for do get placed where they go (from testing), but it doesn’t seem to work, and I’m not sure why.

1 Like

did you add the ‘creating collision parts’ code in your module? if yes try deleting it, and see if the char will ragdoll or not

1 Like

I used it with no change in outcome, and without it, the result still remains the same.

I feel as if the issue is somewhere within this block, but I can’t figure out what’s wrong…

	for i, joint in pairs(character:GetDescendants()) do
		if joint:IsA("Motor6D") then
			local socket = Instance.new("BallSocketConstraint")
			local att0 = Instance.new("Attachment")
			local att1 = Instance.new("Attachment")
			socket.Parent = joint.Parent
			att0.Parent = joint.Parent
			att1.Parent = joint.Parent

			att0.CFrame = joint.C0
			att1.CFrame = joint.C1

			socket.Attachment0 = att0
			socket.Attachment1 = att1
			socket.TwistLimitsEnabled = true
			socket.LimitsEnabled = true

			joint.Enabled = false
		end

can you like resend your whole ragdoll module? just wanna see what’s in the code again

Certainly, I’ve added a few lines to anchor/unanchor the limbs when ragdolling.

local module = {}


function module.ragdoll(character)
	if character.Ragdolled.Value then return end
	character.Ragdolled.Value = true
	
	for _,v in pairs(character:GetDescendants()) do
		if v.Name == "Head" or v.Name == "Left Arm" or v.Name == "Right Arm" or v.Name == "Left Leg" or v.Name == "Right Leg" then
			v.CanCollide = true
		end
	end

	for i, joint in pairs(character:GetDescendants()) do
		if joint:IsA("Motor6D") then
			local socket = Instance.new("BallSocketConstraint")
			local att0 = Instance.new("Attachment")
			local att1 = Instance.new("Attachment")
			socket.Parent = joint.Parent
			att0.Parent = joint.Parent
			att1.Parent = joint.Parent

			att0.CFrame = joint.C0
			att1.CFrame = joint.C1

			socket.Attachment0 = att0
			socket.Attachment1 = att1
			socket.TwistLimitsEnabled = true
			socket.LimitsEnabled = true

			joint.Enabled = false
		end
	end
end

function module.unragdoll(character)
	if character.Ragdolled.Value then return end
	character.Ragdolled.Value = true
	
	for _,v in pairs(character:GetDescendants()) do
		if v.Name == "Head" or v.Name == "Left Arm" or v.Name == "Right Arm" or v.Name == "Left Leg" or v.Name == "Right Leg" then
			v.CanCollide = false
		end
	end

	for i, joint in pairs(character:GetDescendants()) do
		if joint:IsA("Motor6D") then
			joint.Enabled = true
		elseif joint:IsA("BallSocketConstraint") then
			joint.Enabled = false
		end
	end
end

return module

try removing the collisions line, and see if the player will ragdoll then

Results in the limbs falling through the world like before.

try to ragdoll the player when the player is dead, and see if the player ragdolls at all.

(set breakjointsondeath to false)

Doesn’t seem to work on player death, either.

then it must be something wrong with your code… try to check different codes on ragdolls

Like I said before, during testing, all the attachments and sockets get placed where they need to and get the appropriate values, I’m not sure why it’s not working properly, unless I’m missing something, I honestly don’t know.

what is happening to the ragdoll now, after these fixes?

The result is the same, the character’s limbs break off.

1 Like

Hello, can I show my ragdoll module?
It can probably fix this issue and you will probably find a way to find a use for this.
the module