As discussed here and here there’s not a single good way to animate/ragdoll characters on death because their joints break apart. You either have to re-attach the joints (ew), plop in a substitute dummy (bleh), or disable Humanoid’s Dead state with SetStateEnabled (super bleh – I have to re-write the humanoid health system and this doesn’t even work with characters that are exploded). There needs to be a clean way to animate characters on death and ragdoll them.
I’m not sure of a good way to do this due to the nature of joints being uncontrollably destroyed in cases like explosions and other sorts of bugs, but maybe someone can propose an elegant solution to this.
In the case of explosions, I’d suggest dropping DestroyJointRadiusPercent down to 0 and handling joint breaking manually with Explosion.Hit. I don’t know about your case, but I’d prefer for explosions to not be an insta-death, and also not necessarily break the joints of everything, like vehicles, for example, for which I’d rather implement a more custom and gradual damage system. @Davidii and I did this with success in this game, minus the custom vehicle damage part.
If explosions are a sole reason you’re having trouble, consider this.
Right.
Yeah I agree, there definitely should be a Humanoid.BreakJointsOnDeath property.
I know I did manage to make animations work with a death script once, I’ll see if I can find it.
I had already ended up re-attaching the character’s limbs shortly before posting this after exhausting all other options, so if you can’t find it, don’t sweat it.
IMO this is a really bad workaround because you’re having to rewrite how health and death work across your whole game in multiple scripts as opposed to just recreating joints or cloning the character in a single, abstracted module. But as mentioned in the OP, even though better (IMO) than rewriting death/health, those are also pretty bad as well.
@Polyhex I can’t use constraints to animate characters on death to make them grab their chest or something.
I believe you can just do SetStateEnabled and deactivate the Death state on the humanoid. That’s what I did for my game while morphing/re-rigging R15 players.