How to Make a Ragdoll in Roblox Studio (R6 and R15)
To make a Roblox character ragdoll when it dies, stop the Humanoid from breaking its joints, then swap every Motor6D for a BallSocketConstraint. One server script does it. Every property name below is checked against Roblox's API reference.
How a ragdoll in Roblox works
A Roblox avatar is held together by Motor6D joints, which lock each part to the animation. By default the Humanoid deletes those joints on death and the parts fall apart. A ragdoll needs the opposite: keep the parts linked, but loosely. So the script:
- sets
Humanoid.BreakJointsOnDeathto false so the body is not torn apart; - for each Motor6D, places two
Attachments exactly where the joint was (itsC0andC1); - links them with a
BallSocketConstraintwithLimitsEnabledandTwistLimitsEnabledon, so limbs swing but do not spin all the way round; - turns the Motor6D off (
Enabled = false) so the physics takes over.
The ragdoll script for Roblox
In Roblox Studio, add a Script (not a LocalScript) to ServerScriptService and paste:
-- Script in ServerScriptService
local Players = game:GetService("Players")
local function ragdoll(character)
for _, joint in character:GetDescendants() do
if joint:IsA("Motor6D") and joint.Part0 and joint.Part1 then
local a0 = Instance.new("Attachment")
local a1 = Instance.new("Attachment")
a0.CFrame = joint.C0
a1.CFrame = joint.C1
a0.Parent = joint.Part0
a1.Parent = joint.Part1
local socket = Instance.new("BallSocketConstraint")
socket.Attachment0 = a0
socket.Attachment1 = a1
socket.LimitsEnabled = true
socket.TwistLimitsEnabled = true
socket.Parent = joint.Parent
joint.Enabled = false
end
end
end
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid")
humanoid.BreakJointsOnDeath = false
humanoid.Died:Connect(function()
ragdoll(character)
end)
end)
end)
Press Play, then reset your character (Esc › Reset Character). The body should drop and fold at the joints instead of breaking into pieces. It works for both R6 and R15 because it reads whatever Motor6D joints the rig has.
Tuning it
- Limbs too floppy: lower
UpperAngleon each BallSocketConstraint (the cone the limb can swing in, in degrees) and narrowTwistLowerAngle/TwistUpperAngle. - Limbs sinking into the floor or each other: some avatar parts have
CanCollideoff. Turn it on for the arms and legs insideragdoll(), or add small invisible collision parts. - Ragdoll while alive (for a knockdown or a ragdoll key): call the same function, then
humanoid:ChangeState(Enum.HumanoidStateType.Physics). To stand up again, delete the sockets, re-enable the Motor6Ds and change the state toGettingUp. - The neck: Humanoids die when the neck joint is gone while
RequiresNeckis true. If you ragdoll a living character, setHumanoid.RequiresNeck = falsefirst.
The pieces, with Roblox's docs
| Name | What it does here |
|---|---|
| Humanoid.BreakJointsOnDeath | Keeps the joints when the character dies (also settable for every player via StarterPlayer.CharacterBreakJointsOnDeath) |
| Motor6D | The animated joint we switch off; its C0 and C1 tell us where the joint sits |
| BallSocketConstraint | The loose joint that replaces it; LimitsEnabled, UpperAngle and the twist limits control how far it bends |
| HumanoidStateType.Physics | Stops the Humanoid from fighting the physics when you ragdoll a living character |
Property and function names were checked on November 19, 2026 against Roblox's API dump and Creator Hub reference pages linked above.
Want to see what other developers did with this? The best Roblox ragdoll games list has live player numbers, and ragdoll physics explained covers the theory and other engines.
Questions
Does this ragdoll script work for R6 and R15?
Yes. It loops over every Motor6D the character has, so it handles the 6 joints of R6 and the 15-part R15 rig the same way.
Why does my character fall apart instead of ragdolling?
Humanoid.BreakJointsOnDeath is still true, so Roblox removed the joints before the script could replace them. Set it to false when the character spawns, as in the script.
Should the ragdoll run on the server or the client?
Run it on the server, as here, so every player sees the same body. Physics for a player's own character is usually simulated by that player's device, so the motion can look slightly different for others.