Search Unity

Disconnecting players in UNET

Discussion in 'UNet' started by ICY4U, Oct 4, 2020.

  1. ICY4U

    ICY4U

    Joined:
    Mar 12, 2019
    Posts:
    1
    Hey so I'm making a game where its 1v1 and when someone disconnects I would like it to do it without a billion errors

    I'm using a Network Manager (Custom) but OnPlayerDisconnected() uses the NetworkPlayer which is deprecated

    What override should I use & How do I disconnect them nicely

    Code (CSharp):
    1. private void OnPlayerDisconnected(NetworkPlayer player)
    2. {
    3.         // Stop Game
    4. }