Tom_atoes Customisable Ragdoll

humanoid
#1

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.

35 Likes
How would i do ragdolling?
closed #2

This topic was automatically closed after 1 minute. New replies are no longer allowed.

opened #3
1 Like
#4

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

1 Like
#5

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.

#6

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
#7

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)
#8

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

1 Like
#9

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

1 Like
#10

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

#11

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)
1 Like
#13

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