Ragdoll Floats Away

My ragdoll floats away whenever platformstand/sit is disabled, when enabled the ragdoll’s limbs clip through the floor but does not fly away. I need it disabled so it does not clip, how do I fix this, or is there any alternatives? The main problem is that, it keeps reverting the properties.

Floats away like this with platform stand disabled:
Saved as C:\Users\seanc\OneDrive\Desktop\Roblox Studio Files\SeansRagdoll.rbxl - Roblox Studio (gyazo.com)

Code:

script.Parent.Touched:Connect(function(hit)

	if hit.Parent:FindFirstChild("Humanoid") then
		local humanoid = hit.Parent.Humanoid

		if not humanoid:FindFirstChild("Ragdolled") then

			local character = hit.Parent

			local ragdolledVal = Instance.new("BoolValue")
			ragdolledVal.Name = "Ragdolled"
			ragdolledVal.Parent = humanoid
			humanoid.AutoRotate = false
			character.HumanoidRootPart.Anchored = false
			humanoid.PlatformStand = false
			
			humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp,false)
			--humanoid.
			humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,true)
			humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
			--humanoid:SetStateEnabled(Enum.HumanoidStateType.Physics,true)
			humanoid:SetStateEnabled(Enum.HumanoidStateType.Running,false)
			--humanoid:SetStateEnabled(Enum.HumanoidStateType.None,true)
			
			character.HumanoidRootPart:SetNetworkOwner(nil)
			--humanoid:SetNetworkOwner(nil)
			
			character:WaitForChild("Animate").Disabled = true
			
			for i, v in pairs(character:GetDescendants()) do
				
				if v:IsA("Motor6D") and v.Parent.Name ~= "HumanoidRootPart" then

					local attach0 = Instance.new("Attachment")
					attach0.CFrame = v.C0
					attach0.Parent = v.Part0

					local attach1 = Instance.new("Attachment")
					attach1.CFrame = v.C1
					attach1.Parent = v.Part1

					local BallSocketConstraint = Instance.new("BallSocketConstraint")
					BallSocketConstraint.Parent = v.Parent
					BallSocketConstraint.Name = v.Name
					BallSocketConstraint.Attachment0 = attach0
					BallSocketConstraint.Attachment1 = attach1
					BallSocketConstraint.LimitsEnabled = true
					BallSocketConstraint.TwistLimitsEnabled = true
					BallSocketConstraint.Enabled = true
					v:Destroy()

				elseif v:IsA("MeshPart") or v:IsA("BasePart") or v:IsA("CharacterMesh") and v.Name ~= "HumanoidRootPart" then
					v.CanCollide = true
					
					--local collider = Instance.new("Part")
					--collider.Transparency = 1
					--collider.Size = v.Size
					--collider.CFrame = v.CFrame
					--collider.Name = "Collider"
					--collider.CanCollide = true
					--collider.Parent = character
					
					--local weld = Instance.new("Weld")
					--weld.Parent = v
					--weld.Part0 = v
					--weld.Part1 = collider
					
				end
				
				humanoid.AutoRotate = false
				character.HumanoidRootPart:SetNetworkOwner(nil)
				character.HumanoidRootPart.CanCollide = false
				--character.HumanoidRootPart.Parent = nil
				--humanoid:SetNetworkOwner(nil)

				--character.HumanoidRootPart.Anchored = true
			end
		end
	end
end)	

So my main question is, how do I prevent the ragdoll from flying away, while being able to keep platform stand and that disabled? While ragdoll being able to move around still

Ragdoll keeps either floating away or glitching, seems to be from humanoidrootpart or humanoid,
https://gyazo.com/bd157a475fc04824f2e17bf29f1c95b3

You can make a BodyVelocity in the HumanoidRootPart in order to keep the ragdoll from moving.

Thanks for the response, but that wont really work.

1 Like

I got this problem once, and to fix it you need to set HumanoidRootPart network ownership to nil, so what happens is you set the state to ragdoll, then a player comes near and the network ownership becomes player, this causes the state to change which makes the humanoid float.

I will try this! I will respond if it works.
Also, the humanoid, or rootpart?

Your solution worked for the npc, but player ragdoll still floats away.

edit: npc still glitches most of the time.

NPC:


Player:

Funny thing is that it is fine in r6
image

although r6 also glitches too sometimes

https://gyazo.com/9cb6cbb0796550b03ac8beddb80ab77d

for player you need to change the state in localscript. and also disable gettingup state so it doesnt glitch.

and for the network ownership change the rootPart not the Humanoid you can only set network ownership on Unanchored Baseparts.

for the humanoid root part you need to weld it to the torso so it doesnt glitch.

1 Like

I attempted this, it ended up with still being glitched or the ragdolls being cut in half.

local collisionService = game

script.Parent.Touched:Connect(function(hit)

	if hit.Parent:FindFirstChild("Humanoid") then
		local humanoid = hit.Parent.Humanoid

		if not humanoid:FindFirstChild("Ragdolled") then

			local character = hit.Parent
			character.HumanoidRootPart:SetNetworkOwner(nil)
			local ragdolledVal = Instance.new("BoolValue")
			ragdolledVal.Name = "Ragdolled"
			ragdolledVal.Parent = humanoid
			humanoid.AutoRotate = false
			character.HumanoidRootPart.Anchored = false
			humanoid.PlatformStand = false
			character.HumanoidRootPart:SetNetworkOwner(nil)
			
			humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp,false)
			--humanoid.
			humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,true)
			humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
			--humanoid:SetStateEnabled(Enum.HumanoidStateType.Physics,true)
			humanoid:SetStateEnabled(Enum.HumanoidStateType.Running,false)
			--humanoid:SetStateEnabled(Enum.HumanoidStateType.None,true)
			
			character.HumanoidRootPart:SetNetworkOwner(nil)
			--humanoid:SetNetworkOwner(nil)
			
			--character:WaitForChild("Animate").Disabled = true
			character.HumanoidRootPart:SetNetworkOwner(nil)
			for i, v in pairs(character:GetDescendants()) do
				
				if v:IsA("Motor6D") and v.Parent.Name ~= "HumanoidRootPart" then

					local attach0 = Instance.new("Attachment")
					attach0.CFrame = v.C0
					attach0.Parent = v.Part0

					local attach1 = Instance.new("Attachment")
					attach1.CFrame = v.C1
					attach1.Parent = v.Part1

					local BallSocketConstraint = Instance.new("BallSocketConstraint")
					BallSocketConstraint.Parent = v.Parent
					BallSocketConstraint.Name = v.Name
					BallSocketConstraint.Attachment0 = attach0
					BallSocketConstraint.Attachment1 = attach1
					BallSocketConstraint.LimitsEnabled = true
					BallSocketConstraint.TwistLimitsEnabled = true
					BallSocketConstraint.Enabled = true
					v:Destroy()

				elseif v:IsA("MeshPart") or v:IsA("BasePart") or v:IsA("CharacterMesh") and v.Name ~= "HumanoidRootPart" then
					v.CanCollide = true
					
					--local collider = Instance.new("Part")
					--collider.Transparency = 1
					--collider.Size = v.Size
					--collider.CFrame = v.CFrame
					--collider.Name = "Collider"
					--collider.CanCollide = true
					--collider.Parent = character
					
					--local weld = Instance.new("Weld")
					--weld.Parent = v
					--weld.Part0 = v
					--weld.Part1 = collider
					
				end
				
				local RootPartWeld = Instance.new("Weld")
				RootPartWeld.Name = "RootPartWeldRagdoll"
				if character:FindFirstChild("UpperTorso") then
					RootPartWeld.Part0 = character.UpperTorso
					RootPartWeld.Part1 = character.HumanoidRootPart
					RootPartWeld.C0 = character.UpperTorso.CFrame
				elseif character:FindFirstChild("Torso") then
					RootPartWeld.Part0 = character.Torso
					RootPartWeld.Part1 = character.HumanoidRootPart
					RootPartWeld.C0 = character.Torso.CFrame
				end
				RootPartWeld.Parent = character.HumanoidRootPart
				
				humanoid.AutoRotate = false
				character.HumanoidRootPart:SetNetworkOwner(nil)
				character.HumanoidRootPart.CanCollide = false
				--character.HumanoidRootPart.Parent = nil
				--humanoid:SetNetworkOwner(nil)

				--character.HumanoidRootPart.Anchored = true
			end
		end
	end
end)	

This looks like a motor6d problem.
Try disabling the motor6d by setting the Enabled value of the motor6d to false

I destroyed all the motor 6d’s i think

I was struggling with this myself earlier today. I inserted a body velocity into the HumanoidRootPart, and I set the velocity to Vector3.new(0, -1000, 0) and that worked for me.

That wont work well for me, I want the ragdolls to move around freely.

1 Like

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