Inconsistent character removal when player leaves

Theres a chance that Player.Character will be nil during Players.PlayerRemoving. This happens about 50% of the time.

Here’s a very simple repro place:
repro.rbxl (53.0 KB)

Expected behavior

I would like Player.Character to consistently still exist during Players.PlayerRemoving. It would also be nice if we had the choice to unset Player.Character in that moment so that the character wouldn’t be removed at all.

My reasoning is that in my game I want the player’s character to turn into a ragdoll when they leave the game and currently that’s not possible to do consistently.

7 Likes

Thanks for the report! We’ll follow up when we have an update for you.

2 Likes

I haven’t been able to reproduce this, (the character is always gone) - but if you would like an option to have characters remain in play after a player leaves, please resubmit this on the feature request board.

Thanks!
-:skull:

1 Like

I don’t think it would be okay to do that, could cause memory leak problems

@lannior your problem can simply be solved by cloning the character on spawn and then replacing it with the actual character once they leave

Make sure Character.Archivable = true

OR

you can hold a reference to the Character on spawn then reparent it to workspace, this should work fine and it’s a lot simpler

1 Like