Ragdoll Floating Issue

I have this WIP Ragdoll script, I can’t seem to overcome this issue where the character just floats instead of flopping.

--Serverscript
game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local humanoid = character:WaitForChild("Humanoid")
		humanoid:GetPropertyChangedSignal("Health"):Connect(function()
			if humanoid.Health <= 0 then
				humanoid.Health = 1
				for index, joint in pairs(character:GetDescendants()) do
					if joint:IsA("Motor6D") and joint.Name ~= "Head" 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
		
			end
		end)
	end)
end)

1 Like

I found out that simply changing the HumanoidStateType to “Physics” in a localscript fixed it

2 Likes

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