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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Third Party PhotonNetwork.instantiate issue

Discussion in 'Multiplayer' started by zhbjvd, May 7, 2014.

  1. zhbjvd

    zhbjvd

    Joined:
    Dec 17, 2013
    Posts:
    12
    Hi,

    I am using photon unity networking. To spawn players on local and remote devices(iOS and android), I am using this function PhotonNetwork.Instantiate. When new player gets connected , It automatically spawns the player at remote device. I have created custom matchmaking in which it make's sure every client receive all the required data for starting the game and also checks if total responses received (map received message sent back to master/host) available are equal to total number of remote players spawned. I tested it and it works perfectly fine during testing. Now, app is live, Most of the times everything works fine but I noticed sometimes room gets freezes and game doesn't start. When I debugged the issue, I found out that sometimes for example if 3 other clients are connected then only one network player spawned. I didn't destroyed any player object. Does anyone having same issue? How can I make sure all the players are spawned ? Is this because of the latency or clients connection issue ?:confused:
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,021
    It would be interesting to have a look at the logs when this happens but this will be pretty difficult to get.
    Could your clients maybe break if some player leaves at some unexpected moment?
     
  3. zhbjvd

    zhbjvd

    Joined:
    Dec 17, 2013
    Posts:
    12
    What do u mean by break ? leave/disconnect or crash ?
     
  4. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,021