As a Roblox developer, it is currently incredibly painful to switch out R15 limbs, due to the peskiness of our friend the Humanoid.
Whenever the neck joint is removed, the Humanoid’s dead state gets immediately triggered. While in the dead state, all joints are forcefully broken during every single physics step. So if you try to create new joints, they usually disappear before you can revive the Humanoid.
Now you might think that we can work around this by using SetStateEnabled, but heres where things get weirder.
Humanoid:SetStateEnabled("Dead",false) does not replicate across the server-client boundary, so you have to make sure it is set on the client as well via a RemoteFunction. On top of that, we also have to verify that the joints replicated after we apply the new limbs so that we don’t accidentally kill the player while we re-activate the dead state.
So to sum it up, this is the current protocol required to switch out Humanoid limbs on the server for a player:
- Make sure the Dead enabled state is set to false on both the server and client through a RemoteFunction
- Swap out the old limbs for the new limbs.
- Call Humanoid:BuildRigFromAttachments()
- Ping the client through a RemoteFunction up to 10 times until it confirms that all RigAttachments have corresponding Motor6D instances generated.
- Make sure the Dead enabled state is set to true on both the server and client through a RemoteFunction.
As you can see, this is kinda ridiculous. I think there should be a more straight-forward way of going about with this, because it would be really difficult for an inexperienced developer to figure out how to do this correctly.
The ultimate underlying problem here is that the Humanoid is incredibly picky while in its Dead state.