Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How disable auto remove objects on client, when disconnect

Discussion in 'Multiplayer' started by fdsagizi2, Apr 4, 2017.

  1. fdsagizi2

    fdsagizi2

    Joined:
    Nov 4, 2013
    Posts:
    70
    Hi, we have HEAVY objects like cars, and humans. And we use pool for this - for reuse

    When we lost connection(or close) on CLIENT side, unity automatically remove this objects!

    How on client, we can do disable Destroy for this objects, and use - UnSpawn?

    Thanks!
     
  2. fdsagizi2

    fdsagizi2

    Joined:
    Nov 4, 2013
    Posts:
    70
    Wonderful in unity 5.6 this objects call UnSpawn! Thank unity!
     
  3. DungDajHjep

    DungDajHjep

    Joined:
    Mar 25, 2015
    Posts:
    201
    On extend class from NetworkManager

    public override void OnClientDisconnect(NetworkConnection conn)
    {
    Debug.Log("OnClientDisconnect " + conn.address);

    //StopClient will call here and auto destroy gameobject
    //base.OnClientDisconnect(conn);

    }

    read unet hlapi from bitbucket
     
    Deleted User likes this.