Don't Destroy disconnected players

When a player disconnects, I would like to keep their GameObject in the scene for a little while, rather than have it immediately destroyed. Is there a supported way of doing this? I suppose an alternative is to set up a separate GameObject that isn’t a NetworkBehaviour to represent the players, though this will make the code less intuitive.

You can override NetworkManager’s OnServerDisconnect with an empty method. The default NetworkManager destroys the player’s GameObject there.

2 Likes