Trying to make a ragdoll for a character

Hey, so recently I’ve been trying to develop a ragdoll system in which your character dies, then it clones your character and uses that to make a ragdoll. That way, when your character respawns that ragdoll will be on the map the rest of the game.

I just grabbed a ragdoller that’s compatible with R15 rigs off of the free models to do this, as I’m a bit unfamiliar with this concept. With that, the code works fine. However, when I decided to actually go about this a different method, by cloning the character, deleting the real character, then editing the cloned character to be the ragdoll, I ran into some problems. Basically, when the cloned character is put into the map, it just stands still, as if it were anchored, and there was no joint movement whatsoever. It was just locked in place. After experimenting with a rig in workspace, not in game, I came to the conclusion that I had to destroy all of the Motor6D’s within each limb in order for the BallJointAttachments (Or whatever the code used, I think it was something like that) to override the other joints and to work properly. When I did that in studio test it worked fine. But when I tried to get the script to remove these motors, they appear to be hidden from the code and all that I’m capable of removing are the actual attachments within the limbs, which ruins everything and does not allow the BallJoints to do anything, the limbs just fall off…

Any help here appreciated. Thanks.

4 Likes

Do you think you can try using HumanoidDescriptions to make a ragdoll system? Or is this not supported? I’m not too sure if it exists, but if it is possible, it could be much easier than what you are attempting.

(Also this seems to be an XY problem.)

2 Likes

Hm, that’s true. Although I’d need some further information on that, as I’m pretty new to humanoid descriptions, and I thought that was mostly for character appearance. Thank you for the response!

2 Likes

They recently added this to humanoids: I need information if you used the feature of BreakJointsOnDeath.

HumanoidDescriptions are only for appearance, like an describing note about what the character wears and such. It’s barely relevant with physics(except for the weight from each item).

Also missing script to be posted here. Sample the relevant blocks of the code and I might be able to understand what happened.

3 Likes

Hey thanks for the response. This might actually be turned on, I’ll have to check out the humanoid and see for sure, I’ll also then try turning it off and seeing if that works at all.

I mean, I do have code but it all works. (the ragdolling) It’s just when I cloned the character model in whole and then applied the ragdoll to that rig instead, the character just remains rigid and does not respond to physics. (acts like it’s anchored.)

1 Like

Hey, so yeah I tried turning the property off to see if that made a difference but it still reacted the same way. Very odd. The only way I can get the rig to respond to the joints is by destroying the Motor6D’s within each limb, and just my luck, I cannot do this within scripts. I guess they hide at run time.

Any ideas here? All out of luck…

EDIT: I also made a GIF to showcase the only way I’m aware to get the ragdoll to work on the rig, just can’t figure out how to remove these motors from within scripts themselves…

https://gyazo.com/20172b3758a7f508d7ebe8ce52deae65

1 Like
for i, v in pairs(character:GetDescendants()) do -- replace character with the character
    if v:IsA("Motor6D") then
         v:Destroy()
    end
end

Apparently you have to do this client-sided, if you can’t do it in a server script. This is a guess.

1 Like

Oh wow, I see. Thanks for that, will try some stuff. Might be difficult to do this because the server handles the ragdolls…might be hard :confused:

My ragdoll system is on the server. All I do is replace the motor with a constraint (ballsocket or hinge), then I just set the constraint’s properties to what I want. (this is r15)

4 Likes

For a basic rag doll it is relatively easy to do this for a humanoid due to how all the parts are named.

  • Get a list of all the motor6d objects in the character.
  • loop over that list and assign the part0 and part1 values to variables.
  • find the child that starts with the motor name+“RigAttachment” for each of those two variables
  • assign those to the Attachment0 and Attachment1 properties of a ball socket constraint
  • parent the constraint to the motor’s parent
  • del the motor

That’s pretty much it. I also deleted the humanoid in my test and played around with anchoring parts to stop the rag doll from jittering endlessly.

3 Likes

Take a look at this:

https://devforum.roblox.com/t/ragdoll-effect/38092/2

@badcc’s reply in particular. Also, FYI, the link is broken. Use one of the other ones posted below.

2 Likes

Also see this

2 Likes

Dont work i test it bug arm do not be radgoled but fall down to void