Help with ragdoll collisions

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? When you die with a tool (guns, melee), you actually don’t die and you ragdoll with your body parts being all cancollide on so the characters parts doesn’t go underneath the floor.

  2. What is the issue? I cannot figure how to do so, now the reason why I want cancollide on when you die, is cause when resetting in roblox, it automatically sets them cancollide. Which is perfect for my issue.

  3. What solutions have you tried so far? Tried looking over devforum posts and youtube, didn’t find much help just regular ragdolls with the same ragdoll.

I made it so when you are below 10 health and was shot you get your motor6d’s automatically removed, that’s how the ragdoll functions itself. I couldn’t find a way to just disable death and let him stay like that.

let’s take da hood for an example, or many other games like the streets. when you get killed you ragdoll down the ground and stay there until you are rescued, or self-healed.

Any help would be appreciated, Thanks!

1 Like

Try using fake health instead. When it falls below 0, put the player into a ragdoll state where they’ll be stuck like that.

You’d just need to refactor code to modify the user’s fake health instead of their humanoid health. As soon as the humanoid enters the dead state you cannot restore it back to any other state, and the character will respawn automatically.

2 Likes

Fake Health?, Sorry it’s one of the first time I’ve heard about that xD!

Use either an attribute on the character or a NumberValue to store fake health. This makes it so once it reaches 0 the character doesn’t die automatically (how humanoids naturally function)

Better outline:

local function doDamage(damageAmount)
    char.Health.Value -= damageAmount

    if char.Health.Value <= 0 then
        --//Put character into a ragdoll state at this point
    end
end
1 Like

But how do we force set the collision on for body parts?

Could you explain it a bit better? I am sorry I am not well when it comes to understanding English even though it’s my main language

Even if roblox terminated me falsely I can still help! I just can’t test (a heads up for you)

Sure, no problem!. This is what I mean by body parts being
image
and
image, now you might be confused on how I got it to be cancollide on. Well actually it was automatically turned on by roblox when you reset, I want it to function like that when I ragdoll. I’ve tried to use a loop to set the bodyparts cancollide on but no luck.

I just tested this out myself. Setting the humanoid state to Physics allows you to do this.

--//client code
char.Health:GetPropertyChangedSignal("Health"):Connect(function()
if char.Health.Value <= 0 then
char.Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
end
end)
1 Like

Cancollide on, body parts?

characters 30

What I do is a hacky solution but I just add clone the bodyparts in the character, break their joints via part:BreakJoints() put them in workspace and weld them via WeldConstraint to the said bodypart.

You can do this with a for loop, if you need an example ask me. :slight_smile:

Yes. It causes the humanoid’s limbs to collide with parts.

I’ve thought of doing that, my first attempt was a failure tho.

I will try this :D!

characters 30 limit

It worked for me way back when I did it, make sure the part’s anchored if false, cancollide is true. And can you send me the code you tried for it?

I’ve deleted that code, caused my game to crash xD!

Oh, do you want me to show you an example of it? My way may be a bit different.

If you’d like, I would appreciate it! :smiley:

-- whatever ragdoll funny stuff goes on here lol.
for _, v in ipairs(Character:GetDescendants()) do
  if v:IsA("BasePart") then
    local p = v:Clone()
    p.Anchored = false
    p.CanCollide = true
    p.CFrame = v.CFrame
    local w = Instance.new("WeldConstraint")
    w.Part0 = v
    w.Part1 = p
    w.Parent = p
  end
end

So this adds a weldconstraint on the player, and it’s welded to a clone of you?

If you destroy the Neck weld (Motor6D) then the player will die. If you don’t delete the Neck and use @C_Sharper’s suggestion about ‘false’ health that might be the easiest way of not dying.
I’ve heard others say they use BallSocketConstraints for ragdoll purposes, with limits for the amount they can rotate & limits on the angles as well, and make them CanCollide true, but also use CollisionGroups so the body, arms and legs don’t collide with each other at each joint.

1 Like