(Reuploaded) Why doesn't the character ragdoll properly?

I made a combat system for my game, and I am trying to have the character hit with the gun to ragdoll. But for some reason, the character will ragdoll, but the character won’t fall to the ground! I have tried deleting joints, messing around with the humanoid, and other things of that sort, but nothing I do seems to work!

Character after being hit:
Screenshot 2023-11-26 132740

You can see the character will stay up, with only their arms and legs going limp. So it is maybe something to do with the HumanoidRootPart, Torso, or Head, but I am not entirely sure.

The code for the ragdoll (Which will run once a part is hit:)

for i, joint in pairs(hitCharTwo:GetDescendants()) do
	if joint:IsA("Motor6D") then
		local socket = Instance.new("BallSocketConstraint")
			local a1 = Instance.new("Attachment")
			a1.Name = "RagdollA1"
			local a2 = Instance.new("Attachment")
			a2.Name = "RagdollA2"
			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:Destroy()
		end
	end
	task.wait(10)
	for i, joint in pairs(hitCharTwo:GetDescendants()) do
		if joint:IsA("BallSocketConstraint") then
			joint:Destroy()
		end
		if joint:IsA("Attachment") then
		      if joint.Name == "RagdollA1" or joint.Name == "RagdollA2" then
	          joint:Destroy()
			end
		end
		local Motor6Ds = game:GetService("ReplicatedStorage"):FindFirstChild("Motor6Ds")
		Motor6Ds:FindFirstChild("Neck"):Clone().Parent = hitCharTwo:FindFirstChild("Head")
		Motor6Ds:FindFirstChild("Right Shoulder"):Clone().Parent = hitCharTwo:FindFirstChild("Torso")
		Motor6Ds:FindFirstChild("Right Hip"):Clone().Parent = hitCharTwo:FindFirstChild("Torso")
		Motor6Ds:FindFirstChild("Left Hip"):Clone().Parent = hitCharTwo:FindFirstChild("Torso")
		Motor6Ds:FindFirstChild("Left Shoulder"):Clone().Parent = hitCharTwo:FindFirstChild("Torso")
		Motor6Ds:FindFirstChild("Root Hip"):Clone().Parent = hitCharTwo:FindFirstChild("HumanoidRootPart")
	end
end

Motor6D Folder:
Screenshot 2023-11-26 133441

If you need me to provide any more things, please ask me! Thank you for reading! :smile:

1 Like

Note: I think I figured out why the rig is staying up. I made the HumanoidRootPart visible, and it seems that it isn’t falling down whatsoever. I have no clue why it is not, maybe some joints or something, but nothing I do seems to make it fall. Any idea why that is?

Character with the HumanoidRootPart visible:
Screenshot 2023-11-26 210610

The inside of the HumanoidRootPart:
Screenshot 2023-11-26 210642

The RootAttatchment is just something that was already in the rig I got from making it, and it doesn’t seem to affect anything.

Please help! I’ve been stuck on this issue all day!

Try deleting the humanoidrootpart. Mine works all the time

1 Like

I tried this but it still doesn’t work!
I put the same ragdoll script into a player ondeath function, and it works just fine. Maybe it is something to do with the joints?

hey Coreshen, I stumbled apon this post, I am as well having a issue with ragdoll, at least for me there seems to be an issue with the neck. I’ll keep you updated if I find anything.

The character still stands (to my guess) because you arent enabling platformstand

my guess is that or at least for me is that I want collision for limbs on the character, platform removes that.

I have this really old code I’m somewhat ashamed to post lol

function RagDoll(Player)
	if Player.Humanoid.Health > 0 then
		Player.Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
		Player.Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
		task.wait()
		Player.Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
		Player.Humanoid.RequiresNeck = false
		Player.Humanoid.AutoRotate = false
		Player.Humanoid.JumpPower = 0
		Player.HumanoidRootPart.CanCollide = false
		Player.HumanoidRootPart:ApplyAngularImpulse(Vector3.new(-90, 0, 0))
		for index,joint in pairs(Player: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.Enabled = false
			end
		end
	end
end
RagDoll(game.Players.LocalPlayer.Character)

It might be a network ownership issue? there seems to be a contrast from server and client.

Death 1: Client
Death 2: Server

PlatformStand is not enabled on any of my rigs.

Thank you, this worked for me! I changed the HumanoidStateType to Physics and made RequiresNeck false and AutoRotate false, and that’s all it needed! Thank you for the help, I really appreciate it!

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.