Physics Problem with R15 Ragdoll

I’m trying to make a simple ragdoll system with a NPCs and I’m not sure whats going on but the physics dont seem to be working properly.

I have a video here demonstrating it.


edit: I noticed I didn’t crop the video properly. The purple block is the script that enables the isRagdolled Boolean value server sided.

Here is the code that is used here.

image

Lua:

local Char = script.Parent.Parent
local Humanoid = script.Parent

game:GetService("RunService").Heartbeat:Connect(function()
	if Humanoid.isRagdolled.Value == true then
		---//Enable Ragdoll
			for _, v in pairs(Char:GetDescendants()) do
				if v:IsA("Motor6D") then
					local Att0, Att1 = Instance.new("Attachment"), Instance.new("Attachment")
					Att0.CFrame = v.C0
					Att1.CFrame = v.C1
					Att0.Parent = v.Part0
					Att1.Parent = v.Part1
					local BSC = Instance.new("BallSocketConstraint")
					BSC.Attachment0 = Att0
					BSC.Attachment1 = Att1
					BSC.Parent = v.Part0

					v.Enabled = false
				end
			end
		Char.HumanoidRootPart.CanCollide = false
	else
		---//Disable Ragdoll
		for _, v in pairs(Char:GetDescendants()) do
			if v:IsA("Motor6D") then
				v.Enabled = true
			end
		end
	Char.HumanoidRootPart.CanCollide = false
		end
end)

Anything will help!

Are you talking about how when you touched the dummy it flies away?
Are the dummy Parts Massless? That may explain why it flies away like that.

It’s when it ragdolls. It just flies away and I’m not too sure what it is, also the parts do have mass. It doesn’t have anything to do with the purple block. I never touched the dummy too.

Also after a few seconds. It gets flung and gets deleted. Assuming it fell into the void

What happens if you weld the dummy’s HumanoidRootPart to an anchored Part to see what happens with the Motor6D to BallSocketConstraint changes?

I welded it to the baseplate. It just disappears, assuming it got flung into the void.

Then there’s something wrong with the script and the forces that are put into the Parts.

Have you looked into Collision Filtering | Roblox Creator Documentation to make the ragdoll’s Parts not collide with each other, but collide with everything else? Then you could make the limbs joints have BallSocketConstraint | Roblox Creator Documentation and BallSocketConstraint | Roblox Creator Documentation.

I kinda figured out the problem, the RunService was probably too much for it so I replaced it a changed function. it doesn’t get flung which works. I’m trying collision filtering right now.

Another update: Collision Filtering works! except now I need to figure this out lol
image
Edit:
image
i see

another edit: i forgot platform stand exists, everything works!