Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Unity 2022.2 is now available as the latest Tech release.
    Dismiss Notice
  3. We are making some changes to the DOTS forums.
    Dismiss Notice
  4. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  5. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

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:
    154
    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