Humanoid BreakJointsOnDeath false causes immortality bug

  1. What do you want to achieve?
    For players to ragdoll on death, I want to avoid hats falling off. The easiest way to do this is to turn off BreakJointsOnDeath.

  2. What is the issue?
    This creates a bug where the player character has “-inf” health, and doesn’t transition to the “Dead” humanoidstatetype, and doesn’t fire the “Dead” or “StateChanged” events or anything. They can still control their character and use weapons and such, and cannot take any further damage, and since NPCs in the game ignore players with a health of <= 0, they are ignored by enemies anyways. This bug occurs so frequently I’m amazed Roblox hasn’t found and/or fixed this yet.

  3. What solutions have you tried so far?
    I have tried a RS.Stepped check that iterates through each player, and if they have a character with a humanoid, and the health is at or below 0, or if their statetype is dead, or they have the “ForceDeath” attribute (Given by the DamageManager when a character’s health should be at or below 0 from damage being dealt), they will ragdoll, have their root deleted, etc. Despite this, they still sometimes just become immortal “zombies” that cannot die and are ignored by my NPCs since their health is technically below 0.

Since this is an engine level bug I can’t directly address, what are some potential workarounds I could use? Should I just turn back on “BreakJointsOnDeath” and find some way to keep the hats/accessories from falling off? Or is there a better way to force the “Dead” state that actually works?

1 Like

I haven’t witnessed this bug nor was I able to replicate it. Can you confirm that you have CharacterAutoLoads enabled in the Players class property? If this is set to false, you will have to manually call the :LoadCharacter() function, on a humanoid Died event.

1 Like

This isn’t relevant to the issue; I’m not having an issue with characters not respawning, I’m having an issue with them not dying. (My game uses entirely custom spawn logic, respawning any dead players on specific in-game events.)

In that, instead of the .Died event firing as expected and the player losing control of their humanoid, etc., they become immortal, and are able to walk around and use weapons and such despite their humanoid’s health being less than zero. I tried adding a system that every .Stepped connection, checks if a character’s health is at or below zero, and then manually uses :ChangeState() to put them into the “Enum.HumanoidStateType.Dead” state, sets their health to zero, and triggers a ragdoll, etc.

But for whatever reason that doesn’t seem to work; there’s no obvious errors in the console or anything. I looked around on the devforum and other people are having issues with humanoids becoming “undead” when “BreakJointsOnDeath” is set to false, but none of them ever had any kind of solution found.

I am (sometimes, not always) anchoring the rootpart for a death animation to play based on certain in-game criteria, and that does seem to be related. Manually unanchoring the rootpart to ensure the humanoid dies, and then re-anchoring it for the animation, sadly doesn’t seem to work. It appears to be an engine-level bug with humanoids, so I have to “work around it” rather than directly address the issue, which makes this all very tricky and trial-and-error. :frowning:

2 Likes

I’d argue that it is relevant to the issue. Especially if you are utilizing custom logic. However, without being able to see your source code, it’d be exceptionally difficult to troubleshoot your problem. There are a ton of variables with what you’re saying, all of which at this point are unclear. Perhaps add some of your logic and the forum would be able to provide further assistance.

2 Likes