I’ve been attempting to make a ragdoll script for a while now and from what I’ve tried, my methods wont work.
However, the ball socket constraints work just fine. The problem is that when I try to set the humanoid state to physics, the character would just float in the air like its being hanged. Then I tried platform standing the humanoid and the character did ragdoll properly by dropping to the ground, but there was another problem. The limbs and head would always have their can collide property off which means the limbs and head would go through the floor. So I tried using a while loop that would always set the can collide property to true every heartbeat. Even though the while loop was running, the limbs and head would just go through the floor and the can collide would still be false. I was very annoyed by this and I don’t know how to fix it. Another important thing I have to note is that the ragdoll happens while the character does not die.
Is there any other effective way of making the ragdoll or just to fix the issues I had?
I have very limited knowledge on making ragdoll scripts.
The way I did my ragdolls was converting the joints to ball-socket constraints, but then instead of setting humanoid states, I set the CollisionGroup of each BasePart in the character to a custom “Ragdolls” group (which can’t collide with itself), and then enabled collision on all parts except the torso and CollisionPart. I then also unanchored the RootPart and enabled collision on that too.
Now I can’t confirm if returning from ragdoll state works because my game doesn’t let you do that, but this should atleast fix the “hanging” issue (from unanchoring the RootPart), and the limbs going through the floor (from setting the CollisionGroup)
Set platform stand to true when ragdolling. You also have to set the humanoidstate to “Physics” on the client as well or else you’ll get some bugs.
For collisions, my method is making a collision group called “Players” and set every basepart inside of the character to said collision group.
For my system, I take the extra step and make new invisible parts for every limb and set their collision group to “Players.” These parts are here to stop limbs that automatically set themselves to cancollide false. I weld each part to the corresponding limp.