Player body won't fall when Ragdoll

Hi I’m trying to make a Player Ragdoll if they touch a ClickDetector and it didn’t go well for me. Basically the body won’t fall and just stays and I still haven’t gotten any better solutions to fix this.

This is what the bug looks like:

This is the Script I use:

			for index,joint in pairs(Character: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:Destroy()
				end
			end

delete the humanoidrootpart and set the humanoids state to Physics or PlatformStand

Works but the body parts like the legs kinda collides and just bugs

try changing the humanoid state to ragdoll and disabling getting up:
(i just realised that i wrote the code completely wrong here)

for index,joint in pairs(Character: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:Destroy()
	end
end

for _, Character in pairs(Ragdoll:GetDescendants()) do
	if Limb:IsA("BasePart") then
		Limb:SetNetworkOwner(nil)
	end
end

Ragdoll.Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
Ragdoll.Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)

Try adding ragdoll forces through the client. If this doesn’t work, set the humanoid state type to Enum.HumanoidStateType.Physics.

Also – this is extremely important – make sure to END ALL CURRENT ANIMATIONS on the ragdolled player. You can do this by running the following code on the ragdolled player’s client before you start the ragdoll:

for _, v in Humanoid.Animator:GetPlayingAnimationTracks() do
		v:Stop()
end

-- then enable the ragdolling

Doing all three of these things should fix your issue. It fixed mine.

Where’s the Limb at “Unknown global Limb” ?

@WeirdOddz Kind of solved it but bug for me since all body parts has the collision off.

Basically there are no collisions and it’s just a bug

This is the one from WeirdOddz’s Script but no collisions:

Screenshot 2024-03-21 195618

However when you die the collisions eventually are back:

Screenshot 2024-03-21 195621

collisions?

local Character = workspace.Rig

local Hum = Character:FindFirstChildOfClass("Humanoid")
Hum.RootPart:Destroy()
Hum:ChangeState(Enum.HumanoidStateType.PlatformStanding)
for index,joint in pairs(Character: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:Destroy()
	end
end

for _,v in pairs(Character:GetChildren()) do
	if v:IsA("BasePart") then
		local clone = Instance.new("Part",v)
		clone.Name = "hit"
		clone.Transparency = 1
		clone.CFrame = v.CFrame
		clone.Size = v.Size/1.5
		local weld = Instance.new("Weld",clone)
		weld.Part0 = v
		weld.Part1 = clone
		weld.Name = "Join"
	end
end

final result:

2 Likes

Works very smooth. Thanks!

image

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