Non-Player Ragdoll keeps standing back up even when dead

  1. What do you want to achieve? Keep it simple and clear!
    I’m trying to just make a dead good ragdoll. This ragdoll gets cloned once when the player respawns so it stays and doesn’t disappear

  2. What is the issue? Include screenshots / videos if possible!
    The cloned version of the player’s ragdoll stands back up even though its health is 0 and its states have been changed.

Works fine below
image

But a few seconds later…
image

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I’ve tried like every solution from the Developer Hub and what I could think.

-Changing states to dead, physics, ragdoll
-Disabling the GetUp state
-PlatformStand (this works but it sets their part collisions to false which I don’t like),
-Anchoring (I want to be able to move them still)
-Setting health from 0 to 100 and then back to 0 (SOMETIMES works)

local folder = Instance.new("Folder")
folder.Name = "Ragdolls"
folder.Parent = workspace

game:GetService("Players").PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		
		char.Humanoid.BreakJointsOnDeath = false
		
		char.Humanoid.Died:Connect(function()
			
			char.Archivable = true
			
			for i,v in pairs(player.Backpack:GetChildren()) do v:Destroy() end
			for i,v in pairs(char:GetChildren()) do if v:IsA("Tool") then v:Destroy() end end
			
			for index,joint in pairs(char: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
			
			player.CharacterAdded:Wait()
			
			local ClonedChar = char:Clone()
			
			for i,v in pairs(ClonedChar:GetDescendants()) do
				if v:IsA("ForceField") then v:Destroy() end
			end
			
			ClonedChar.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
			ClonedChar.Humanoid.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
			ClonedChar.Health:Destroy()
			ClonedChar.Name = player.Name.."'s Ragdoll"
			ClonedChar.Parent = folder
			
		end)
		
	end)
end)

Alright, I found the solution to my issue ONE minute after posting this SOMEHOW.

Apparently, the reason why changing the states weren’t working is because the player still had ownership of the ragdolls for some reason. So I swapped over ownership to the server and then changed the states, this ended up fixing my issue :slightly_smiling_face:

Here’s the code if anyone has a similar issue.

			for i,v in pairs(ClonedChar:GetDescendants()) do
				if v:IsA("BasePart") then v:SetNetworkOwner(nil) end
			end
			
			ClonedChar.Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
			ClonedChar.Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)

sorry for late reply, but yeah I also had the same issue, but looping through all the parts seems a bit hacky

although the solution is strange, but it works even though there wasn’t even a network owner to begin with

also i’ve check to see if there’s a network owner and it returns nil

print(character.HumanoidRootPart:GetNetworkOwner())
--returns nil

image
all i did was just set the network ownership to the HumanoidRootPart to nil
and that does the trick, I waited at least a minute and it hasn’t gotten up

character.HumanoidRootPart:SetNetworkOwner(nil)
1 Like