I had previously made a ragdoll model in 2016, but there were a number of engine-level shortcomings that made it flawed:
There were no twist limits for BallSocketConstraints, so shoulders would happily turn all the way around where your inner armpit was on the outside of the character
There was no Humanoid.BreakJointsOnDeath property, which made it impossible to support things like preserving welded armor/etc on ragdolls, and made it difficult to support accessories/tools
There was no NoCollisionConstraint, so without creating a bunch of collision groups (potentially game-breaking if a game is already near the max) there was no way to prevent large R15 hitboxes from overconstraining ragdolls
Now that these are no longer an issue, I’ve been able to drastically improve upon where I originally started. The new ragdoll implementation has more realistic constraint limitations, avoids overconstraining, seamlessly preserves any accessories/tools/armor you have equipped, and works with arbitrary characters (e.g. a spider) that don’t conform to the R15 hierarchy.
Works with larger packages:
Works with packages that have excessive clipping:
Zero-G ragdolls!
Complete compatibility with physics
You can test out the ragdolls live in this place (K to kill yourself, or R to toggle ragdoll):
Big props on making this. Just played the test place and this is one of the best ragdoll physics I have seen. Do you have any plans on making it compatible with R6 Rigs?
No plans for compatibility with R6 rigs. The way they’re set up is too different from R15 to support them trivially, and R15 generally supersedes R6 in every regard. It’s an open-source model though, so feel free to adjust it to work with R6.
Alright, I may look into that for the sake of the players committed to classic rigs. I’ll share with you whatever I come up with if I get around to it.
I noticed the walking sounds persist when the ragdoll is created but the humanoid is still alive. This is probably beyond the scope of the ragdoll system, is this supposed to happen?
I guess I can throw some fix in. I think I may have done something similar with animations. Ultimately these are bugs in the core scripts though where they don’t properly obey humanoid state, so it’d be great if Roblox fixed them.
If you’re standing completely still, then maybe, as the package may be able to support itself standing upright. Especially on Zero-G as there are no forces on it. If this happens in any way when you’re moving before you die though, that’s a bug. I’ll need a video or more information to look into it further.
It looks like it’s because StarterCharacters don’t work properly with CharacterAppearanceLoaded. I’ve also noticed an issue where if you try to apply a HumanoidDescription, it will cause issues with the ragdoll.
I’ll look into using a smarter approach that works with character appearances changing / not being tied to the web when I get home today.
I was using this ragdoll, and I noticed that if my character gets exploded, the camera goes flying until it falls past the FallenPartsDestroyHeight. The ragdoll also moves if I’m in first person when my character is dead.
Not sure if you’re still having this problem, since it’s been around 18 days, but I found a fix to humanoids that have Character Appearance = false. Go to the “RagdollTestScript” script and change the following code.
function characterAdded(player, character)
player.CharacterAppearanceLoaded:wait()
wait(0.1)
local humanoid = character:FindFirstChildOfClass("Humanoid")
buildRagdoll(humanoid)
end
Change the above portion of code to the below portion, and it should work.
function characterAdded(player, character)
player.Character:WaitForChild('Humanoid', 60)
player.Character:WaitForChild('HumanoidRootPart', 60)
wait(0.1)
local humanoid = character:FindFirstChildOfClass("Humanoid")
buildRagdoll(humanoid)
end