§ How to · with Picoo

How to make a ragdoll in Roblox

By Sametcan Tasgiran, Founder & Developer·Published ·Updated

A ragdoll that keeps standing up is not a physics problem — the Humanoid is still trying to hold the character upright.

Ragdolling is three steps: break the motors, add constraints in their place, and tell the Humanoid to stop driving.

Motor to constraint swap

Each Motor6D replaced by a BallSocketConstraint on the same attachment pair, so joints stay anatomically correct.

Humanoid handed over

The Humanoid switched to the physics state so it stops fighting the simulation.

Angle limits

Constraint limits enabled so limbs bend like limbs instead of noodles.

Reversible

Get-up restores the motors and the standing state, for stun rather than death.

Network ownership handled

NPC ragdolls pinned to the server so they do not jitter.

Death integration

Ragdoll on death with cleanup timed to the respawn.

Files Picoo ships for this prompt

2 files · 145 lines · ~25s · 1 credit

RagdollService

Motor swap, constraint creation, state change, restore, ownership.

110 lines

RagdollConfig

Per-joint angle limits and get-up timings.

35 lines

Sample output: ServerScriptService.RagdollService

-- A Motor6D already knows the joint's geometry: Part0/Part1 and the C0/C1
-- offsets. Reuse those to place attachments, and the ragdoll bends where the
-- character actually bends instead of at guessed positions.
local function motorToSocket(motor: Motor6D): BallSocketConstraint
	local a0 = Instance.new("Attachment"); a0.CFrame = motor.C0; a0.Parent = motor.Part0
	local a1 = Instance.new("Attachment"); a1.CFrame = motor.C1; a1.Parent = motor.Part1

	local socket = Instance.new("BallSocketConstraint")
	socket.Attachment0, socket.Attachment1 = a0, a1
	socket.LimitsEnabled = true      -- without limits you get noodle limbs
	socket.TwistLimitsEnabled = true
	socket.UpperAngle = 45
	socket.Parent = motor.Part0
	return socket
end

local function ragdoll(char: Model)
	local hum = char:FindFirstChildOfClass("Humanoid")
	if not hum then return end

	-- THIS is the line people miss. Disabling motors alone leaves the Humanoid
	-- still running its stand-up controller, so the character twitches upright.
	hum:ChangeState(Enum.HumanoidStateType.Physics)
	hum.PlatformStand = true

	for _, d in char:GetDescendants() do
		if d:IsA("Motor6D") and d.Name ~= "Neck" then
			motorToSocket(d)
			d.Enabled = false          -- disable, do NOT destroy: get-up needs it
		end
	end
end

Building a ragdoll in Roblox

Ragdolls are a three-line idea surrounded by details that each produce a distinctive, memorable bug.

The first is the one everyone hits: the ragdoll that stands back up. Removing or disabling the character's joints does not stop the Humanoid, which is still running its own controller trying to keep the character upright and oriented. The result is a body that flops and then twitches back to standing. Switching the Humanoid into its physics state, and setting PlatformStand, is what hands control over to the simulation.

The second is where the joints go. A Motor6D already encodes the joint: which two parts it connects and the exact offsets on each. Reusing those offsets to place your attachments means the ragdoll bends where the character actually bends. Guessing positions instead gives you a body whose elbows are somewhere inside the forearm, which looks wrong in a way that is hard to name.

The third is limits. BallSocketConstraint ships with limits disabled, so every joint is free in all directions and the character behaves like a rope. Turning limits on and setting sensible angles per joint — tight for elbows and knees, loose for shoulders — is the difference between a ragdoll and a noodle.

One more, for anything reversible: disable the motors rather than destroying them. Standing back up means re-enabling the original joints with their original offsets and removing the constraints. If you destroyed the motors, you are rebuilding the rig by hand, and it will not come back quite right.

Finally, if your ragdolls are NPCs and they jitter, that is network ownership — the server and a nearby client are both simulating the same body. Pinning simulation to the server fixes it; for player ragdolls, leaving ownership with the player they belong to is usually smoother.

See more on the Luau generator, the game builder, or browse the full blog.

Frequently asked

Why does my ragdoll stand back up?+

The Humanoid is still driving the character. Removing joints does not stop its controller — it keeps trying to balance and re-orient, which produces a body that twitches upright. Humanoid:ChangeState to the Physics state, and set PlatformStand, so it stops applying its own forces.

Should I destroy the Motor6Ds?+

Disable them instead. Getting up means re-enabling the motors and deleting the constraints, and that is only possible if the motors still exist with their original C0/C1 offsets. Destroying them means rebuilding the rig from scratch, which is how get-up animations end up with limbs in the wrong places.

Why do the limbs bend in impossible ways?+

LimitsEnabled is false by default on BallSocketConstraint, so every joint is free in every direction and the character behaves like rope. Enable limits and twist limits, and set an UpperAngle per joint type — elbows and knees want much tighter values than shoulders.

Why does my NPC ragdoll jitter?+

Network ownership. A character owned by a nearby client is simulated there while the server also simulates it, and the two disagree. For NPC ragdolls call SetNetworkOwner(nil) on the root to pin simulation to the server. For player ragdolls, leaving ownership with that player is usually smoother.

Do I need constraints at all, or can I just disable the motors?+

Disabling motors alone leaves the limbs completely unattached — the character falls apart into separate parts. The constraints are what keep the body a body while letting it go limp.

Related Picoo prompts