Weird Ragdoll Bug

Sometimes my arms and legs goes through like parts and my torso goes in air.

local UsernameOfCaught = Players:WaitForChild(chosenHide:WaitForChild("User").Value)
							Remotes:WaitForChild("Caught"):Fire(UsernameOfCaught)
							FinishedTargetting = true
							print(UsernameOfCaught)
							attachRope(Players:WaitForChild(chosenHide:WaitForChild("User").Value), Seeker)
							
							local character = workspace:WaitForChild("PlayersOnRound")[tostring(UsernameOfCaught)]
							local humanoid = character:FindFirstChild("Humanoid")
							humanoid.PlatformStand = false
							
							

							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

You should clone the arms and leg, remove everything inside and weld it back to the arms and legs with cancollide true. This is because roblox doesn’t allow limb.CanCollide = true for arms/ legs and some other limbs.

For the torso, i believe you should humanoid.Sit = true

How do i do that to make it work because I don’t really understand

Made on mobile, expect bugs and/ or errors.

[NOTE]: make sure to enter all legs/ arms/ limbs names

local function setUpCollidable(character:Model)
local collidable = instance.New("Folder")
collidable.Name = "collidable"
collidable.Parent = character
for _, limb in pairs(character:GetChildren() do
if not limb:IsA("BasePart") then continue end
--if limb.Name ~= "Arm", etc... then continue end
local cloned = limb:Clone()
cloned:ClearChildren()
local weld = instance.New("WeldConstraint", cloned)
weld.Part0 = cloned
weld.Part1 = limb
weld.Parent = cloned
cloned.Massless = true
cloned.CanCollide = true
cloned.Parent = collidable
end
return collidable
end)

Example:

local collidable:Folder = setUpCollidable(character)
task.wait(10)
collidable:Destroy()
local UsernameOfCaught = Players:WaitForChild(chosenHide:WaitForChild("User").Value)
							Remotes:WaitForChild("Caught"):Fire(UsernameOfCaught)
							FinishedTargetting = true
							print(UsernameOfCaught)
							attachRope(Players:WaitForChild(chosenHide:WaitForChild("User").Value), Seeker)
							
							local character = workspace:WaitForChild("PlayersOnRound")[tostring(UsernameOfCaught)]
							local humanoid = character:FindFirstChild("Humanoid")							humanoid.PlatformStand = false
humanoid.Sit = true

local collidable = setUpCollidable(character)							
							

							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