Search Unity

Question Not connected event

Discussion in 'Unity Transport' started by Sacus, Aug 10, 2022.

  1. Sacus

    Sacus

    Joined:
    Apr 29, 2022
    Posts:
    4
    Is there a way on client to know when it failed to connect to server ?
     
  2. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    441
    Are you using the core Unity Transport package (
    com.unity.transport
    ) directly or through Netcode for GameObjects?

    If the former, you'll get a
    Disconnect
    event on the connection that failed to be established. If the latter,
    OnClientDisconnectCallback
    should be invoked and the client's
    NetworkManager
    will shut down. By default both should happen after about 30 seconds, but that's configurable.
     
  3. Sacus

    Sacus

    Joined:
    Apr 29, 2022
    Posts:
    4
    I'm using Netcode thanks for your answer