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

What is NetworkConnection.IsCreated?

Discussion in 'Multiplayer' started by zhuchun, May 5, 2019.

  1. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    Hi, I'm using the new multiplayer framework. Lately, when my client tries to connect to a remote host, Editor throws an error like "cannot send data when connecting".

    I thought that NetworkConnection.IsCreated if statement before sending data in the sample code means "When a connection IsCreated, it's connected and ready to send something." Its getter which returns 'm_NetworkVersion != 0' doesn't make sense to me as well.

    Could someone explain what is IsCreated and should I invoke NetworkConnection.GetState before sending data?