Need help with a ragdoll system

hey there, I just want to say this topic is gonna have a quite a few questions, but I don’t mind how many that you answer, as long as it helps :))

lately, I’ve been making a ragdoll system for my game, and I wanna improve on it as much as I can

here are the questions:

  1. when retrieving the state of the player (ragdolled or not), should I use a remote function callback or use attributes on the character?
  2. who should be given network ownership during ragdoll?
  3. how do I prevent flinging/weird collisions?
  4. this ragdolling module uses the original Motor6D joint’s CFrame, but I’m not satisfied with the results, how would I create a custom joint mapping for each part? (was planning to use a modulescript with the settings, but not sure if that’s the most efficient way)
  5. I want to try to recreate The Strongest Battleground’s ragdoll system, which looks really fluid and realistic, any tips on how to achieve this?
  6. should I store ragdoll attributes on the character itself?

I also seem to be encountering a physics bug, where the ragdoll doesn’t touch the ground although there’s nothing in the way and the ragdoll collisions are working fine.

if anybody has any solutions, please help me out! thanks :happy1:

1 Like

You need to do the opposite…
You just need to disable motors and bind ball socket constraints to each limb

the ragdolling module is doing that, it’s just replicating the settings to the BallSocketConstraint


you dont have to create attachments for limbs, roblox rigs already have attachments in places where limbs connect

player have network ownership of his character, so no exception for his ragdoll unless that dead body

since you cant make limbs collidable, you can create invisible hitbox inside each limb and weld it like that, and to prevent flinging you can try to apply some upward force to rig before enabling his motor6d’s

the leg attachments are not in the spots I wanted, I think I’ll only custom map them then
also, why the upward force to prevent flinging?

could anybody help me with question 1, 5 and 6? thanks!

you can prevent flinging by teleporting rootpart right before enabling motor6d’s

local position = character.PrimaryPart.Position -- humanoidrootpart
local hipheight = character.Humanoid.HipHeight

character:PivotTo(CFrame.new(position + Vector3.new(0, hipheight + 1, 0)) -- plus one because of rootpart size

to properly rotate character when he standing up you can use direction from rootpart to head and direction what head is looking

local position = character.PrimaryPart.Position
local headPosition = character.Head.Position

local fromHeadDirection = headPosition - position
local facingUp = character.Head.CFrame.LookVector.Y > 0

local resultPosition = position + Vector3.new(0, hipheight + 1, 0)
local resultDirection = fromHeadDirection.Unit * Vector3.new(1, 0, 1) * (facingUp and 1 or -1)

character:PivotTo(CFrame.lookAlong(resultPosition, resultDirection))