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

NetworkPeerType.Connecting

Discussion in 'Multiplayer' started by AmazingRuss, Oct 19, 2008.

  1. AmazingRuss

    AmazingRuss

    Joined:
    May 25, 2008
    Posts:
    933
    I have a gui that uses Network.peerType to determin what buttons to present. Seems to work ok except for NetworkPeerType.Connecting. When I call Network.Connect() and there is no server up, I would expect Network.peerType to sit on NetworkPeerType.Connecting until it fails, but instead it sits on NetworkPeerType.Disconnected, which makes my GUI confusing for the user.

    Anybody know how this is supposed to work?
     
  2. ProtonOne

    ProtonOne

    Joined:
    Mar 8, 2008
    Posts:
    406
    I've noticed the same thing. My workaround is to use my own variable.

    When I call Network.Connect, I set it to "Connecting", then when OnConnectedToServer or OnFailedToConnect is called, I switch that variable accordingly manually.
     
  3. AmazingRuss

    AmazingRuss

    Joined:
    May 25, 2008
    Posts:
    933
    I was doing something similar until I found the Network.peerType variable....and I tore out all my state management to use it instead. :cry:
     
  4. NirielNabokov

    NirielNabokov

    Joined:
    Dec 22, 2014
    Posts:
    9
    It's 2015 and the problem is still there.