Unity3d Multiplayer Abrupt leave

Hello, I have a multiplayer game and it is great, but when someone leaves using the X, instead of disconnect button, the user leaves but player is still there. But with the button, Both are one(good)

So how would I fix this abrupt leave problem where the char is still there after leave.

I have already done “OnDisconnectedFromServer”

implement the logic in ‘OnPlayerDisconnected’ not in ‘OnDisconnectedFromServer’.

The “OnDisconnectedFromServer” function only runs on the Client leaving, not on the Server. To solve your problem you need the “OnPlayerDisconnected” function. See here: