Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Third Party PUN 2 All players can only see host and themself

Discussion in 'Multiplayer' started by SirBurritos, Jan 31, 2024.

  1. SirBurritos

    SirBurritos

    Joined:
    Sep 15, 2020
    Posts:
    7
    I have a multiplayer game which previously worked fine. However, when a player joins the host can not see them. Also, when a 3rd player joins the game, every player can only see themself and the host. For example, the first player to join (the host) can’t see anyone else and the second and third can only see the first player and themselves. In the hierarchy, the players aren’t there at all when they can’t be seen, and i have debugged and confirmed that they are in the same lobby. I have struggled with this issue for a fairly long while now. As i mentioned, things previously worked well.
    Any ideas from anyone?
     
    Last edited: Jan 31, 2024
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,057
    Are you loading scenes before or short after joining a room?
    Are there any errors in the console log?
     
  3. SirBurritos

    SirBurritos

    Joined:
    Sep 15, 2020
    Posts:
    7
    there’s no photon-related errors in the console and i believe i am loading scene with AutomaticallySyncScene = true in OnJoinedRoom()
     
  4. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,057
    If you set AutomaticallySyncScene = true in OnJoinedRoom(), this is part of the problem.
    You should set it before a client connects. It is a static value and should be on or off for all clients anyways. Some of what it does, happens before OnJoinedRoom().
     
  5. SirBurritos

    SirBurritos

    Joined:
    Sep 15, 2020
    Posts:
    7
    sorry - i worded it strangely. i am loading the scene in OnJoinedRoom() and i also have AutoSyncScene not sync scene in OnJoinedRoom if that makes sense. It’s in awake
     
  6. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,057
    Ok, sorry for taking your description too literal.

    > i am loading the scene in OnJoinedRoom()

    Make sure only the Master Client does this. If everyone loads a scene in OnJoinedRoom, this will mess with the automatic sync. And use the load level method in the PhotonNetwork class.
     
  7. SirBurritos

    SirBurritos

    Joined:
    Sep 15, 2020
    Posts:
    7
    How would i go about this?