[Deprecated] Tom_atoes Customisable Ragdoll

Note: been getting a lot of messages about bugs in this, I am no longer updating it so it may not work.

Hey! So I decided to make my own ragdoll module today, so I thought, why not make it open source?

What’s special about this ragdoll module?

So let me give you a list, this ragdoll module:
• Is easy to use
• Allows a lot of customisation
• Works with both R6 and R15
• Despawn Effects
• Works on NPCs and players
• Room to add your own despawn effects

How do I get it?

You can either download the file or get it as a free model. Both are provided below (The place will not be updated, I recommend taking the free model.):

RAGDOLLEXAMPLE.rbxl (34.1 KB)

Video Example:
exampl

How to use it!

When you insert the model into your place, it will be in a folder.
image

To start, place the “Physics” event into your events folder or into ReplicatedStorage, then go into the settings module and update the location of the event.

Next, place the “Ragdoll” module where ever you like, I recommend ReplicatedStorage. This is what my ReplicatedStorage looks like.
image

Nearly there!

Now go into a LocalScript and do something like this.

local Event = [EVENT LOCATION HERE]
local Camera = workspace.CurrentCamera
local Player = game:GetService("Players").LocalPlayer

Event.OnClientEvent:Connect(function(model, humanoid, plr, recovered)
    if plr == Player and not recovered then
		Camera.CameraSubject = model.Head
		humanoid:ChangeState("Physics")
	elseif plr == Player and recovered then
		Camera.CameraSubject = model.Humanoid
		humanoid:ChangeState("Ragdoll")
	end
end)

There, now we are ready to use the module!

So, the only required argument for the module is the model that you want to ragdoll, everything else is done for you via the settings module. But you can override these settings by adding multiple arguments.

require(game:GetService("ReplicatedStorage").Ragdoll):Activate([MODEL - REQUIRED], [DESPAWN TIME - OPTIONAL], [CONSTRAINT TYPE - OPTIONAL], [CAN DESPAWN - OPTIONAL], [CAN RECOVER - OPTIONAL], [LIMITS ENABLED - OPTIONAL], [DESPAWN TYPE - OPTIONAL])

Example:

require(game:GetService("ReplicatedStorage").Ragdoll):Activate(workspace.Tom_atoes, 5, "BallSocketConstraint", true, "Random")

And boom! Your model will now be ragdolled! The module will check to see if the model is a player, don’t worry! If the model is a player, the player will respawn, unless disabled.

Despawn effects

If you want to change the despawn effect, check out the “Settings” module for the ID / String of the despawn effect you would like to use.
image
To change the current effect or to override one, use the int / string provided.
image

Want to make your own despawn effects? No problem. Inside the “DespawnTypes” module, there is a template so you can add your own ones! If you want to share your effects, reply with your function and I’ll add it in!

Limits Enabled

Inside the settings module there is now five new settings. Four of which are related to this.

We are looking at MIN, MAX, RES and LIMITSENABLED.

MIN is the minimum angle that the constraint can get to whilst MAX is the maxium. RES is the Restitution, find out more here.

Disclaimer: These only work with HingeConstraint’s and BallSocketConstraint’s at the moment.

Can Recover

Quick update, you can now enable the CanRecover property so that rig is rebuilt! This will just wait [DESPAWNTIME] until rebuilding it. Don’t like the way it works? No problem! Just run this code whenever you need!

Model.Humanoid:BuildRigFromAttachments()
Model.Humanoid:ChangeState("Ragdoll")
-- // set player camera subject back to humanoid here.

Big disclaimer: This will not work on an R6 rig due to a Roblox bug. Hopefully this is fixed in the future.

Enjoy and have a nice day!

Bug? Contact me on these platforms:
Roblox Messages - Tom_atoes
DevForum Messages - Tom_atoes
Twitter - @_Tom_atoes

Or just reply to this thread.

151 Likes

Note: This must be used on the server, using it on the client will result in the death of rig.

8 Likes

Do you think you could add a gif of how it looks with the R15 rig? Every time I’ve tried making an R15 ragdoll, the joints spaz out because of different packages bundles having different collisions.

You can try it out in the test place, currently not at home and won’t be for a few days. There is a GIF with the R15 rig in the background.

1 Like

Update:

  • Fixed bug where a player dies and all current cameras are set to that players view.
  • Collisions are now only set for the client that was ragdolled.
  • General preformance enhances.
New client code
local Event = [EVENT LOCATION HERE]
local Camera = workspace.CurrentCamera
local Player = game:GetService("Players").LocalPlayer

Event.OnClientEvent:Connect(function(model, humanoid, plr)
    if plr == Player then
		Camera.CameraSubject = model.Head
	end
    humanoid:ChangeState("Physics")
end)

Love the ragdolls, any way you can update it so they can be toggled by bool?

1 Like

Try it out in R15 Rig, animate it and try it!

1 Like

So like a temp ragdoll? I’ll work on a recovery state now, but you could just disable despawn and use Humanoid:BuildRigFromAttachments()

1 Like

Update:

  • New settings “CanRecover” and “LimitsEnabled”. Both have been documented in the new edit. (CanRecover suggested by @etensai)
  • Constraint Limits, allows you to control the way your ragdoll works.
  • Local script now part of the model for you lazy people.
New client code
local Event = [EVENT LOCATION HERE]
local Camera = workspace.CurrentCamera
local Player = game:GetService("Players").LocalPlayer

Event.OnClientEvent:Connect(function(model, humanoid, plr, recovered)
    if plr == Player and not recovered then
		Camera.CameraSubject = model.Head
		humanoid:ChangeState("Physics")
	elseif plr == Player and recovered then
		Camera.CameraSubject = model.Humanoid
		humanoid:ChangeState("Ragdoll")
	end
end)
2 Likes

I’ve been looking for something similar thanks a lot! The customization helps a lot too because i have no idea whats going on with some of these ragdoll scripts

Awesome work… Just a few things…

  1. Humanoid Root Part Location
    The humanoid root part doesn’t stick w/ the charatcer, hence if they fall off a roof or elevated part, they will get back up wherever their humanoid root part originated from before the ragdolling. Refer to: https://gyazo.com/2c97060d8ffb0ff9d2ad68d3cc37fc08
  2. Help setting up for R15?
    By default, the character looks really really strange for R15. It’d be really helpful if we could be provided some insight, or examples, on how to set it up to look better for R15 w/ these weird rotated joints: https://gyazo.com/55a5cecdd6f738f13326eb32da3ea050

Other than that, great contribution! :slight_smile:

For the second point, you can change the joint type to HingeConstraint, it should look more natural which is the reason why I added it. You can try edit the Min and Max joints as well to help you achieve the look. As for the first point, I am aware of this issue I’ve just been extremely busy but I will try to get it resolved today. Thank you for the feedback!

1 Like

Hey all. Fixed an issue that you guys have been having with the HumanoidRootPart, sorry for not being able to fix this sooner but I hope it solves your issues. If you have any questions or suggestions feel free to contact me. Enjoy!

1 Like

Hey nice work!
Just when you can push this in the next update:
Add: self.Model.HumanoidRootPart:FindFirstChild("WeldConstraint"):Destroy()
to line 175 in Ragdoll.Lua
Prevents a weird glitch when standing up from ragdoll

2 Likes

Ok, So I seen u added something in the module that detects the rig type but every time I go to test it in R6 it searches for the R15 bodyparts

https://gyazo.com/16d8f9a225188450fe0dcc82fd6aae93

image

I was wondering if i did anything wrong in my part, I set it up the same way u have it setup in your test place

3 Likes

Unfortunately, it doesn’t work with packages, like ‘The Crook’. I’ve tried it out and it’s providing the ability to walk around and jump around when ragdolled.
image
When walking around during ragdoll.

image
When jumping during ragdoll.

image
When resetting during ragdoll.

I’ve tried HingeConstraint and BallSocketConstraint and they both don’t work. I need to recover the character after the specified duration.

Another issue: After recovering, an issue is appearing:

image
The character before ragdoll.

image
The character after recovered ragdoll.

2 Likes

https://gyazo.com/690e7596408ab6e4f5cac145835d5542

Does this module only apply for players? It works completely fine with players, but not NPCs or dummies.

1 Like

Dude you rock! This is exactly what I needed!

1 Like

Does it work? And @Tom_atoes, could you please make the latest version or help with my code? I am able to ragdoll from a local script but not from server script.

Had the exact same problem. No idea how to solve it!