Sync two players in VR

Hey guys,
For my university project I have a setup of two HTC Vives and I use SteamVR, Photon Pun 2 and the VRTK plugin from Github.

I followed the Photon Pun 2 Basic Tutorial successfully including step 4. What I want to achieve now is to have two players in one scene. Therefore I tried instantiating the player. What I got so far is the first player who can see and move his own controllers and the second player who sees the controllers of both player but only moves the ones from the first player.

You can see the project on Github.

Any help or ideas would be very much appreciated since I struggle with this problem for over a week now.

Comments

  • Hello @Romina

    Can i know how u instantiate the player to be in the same scene? Because i am having the same issue which both of my player are in the same room however they can t see each other.
    Thank you.
  • Romina
    Romina
    edited October 2019
    It seems like I'm on the exact same level as you right now. I instantiate the players like this:
    
    GameObject VRTK_Setup;
    
    public void Start()
    {
          if (PhotonNetwork.IsMasterClient)
          {
                VRTK_Setup = PhotonNetwork.Instantiate("VRTK Setup", transform.position, transform.rotation, 0);
          }
    }
    
    This gives me two players that can see their own hands and interact with objects in the scene. But they can't see each other, only the objects that are moved. However, the problem is that the client player is disabled when it is loaded. I can't figure out why yet.

    I have also tried the following:
    
    GameObject VRTK_Setup_Master;
    GameObject VRTK_Setup_Client;
    
    public void Start()
    {
          if (PhotonNetwork.IsMasterClient)
          {
                VRTK_Setup_Master = PhotonNetwork.Instantiate("VRTK Setup", transform.position, transform.rotation, 0);
          }
          else 
          {
                VRTK_Setup_Client = PhotonNetwork.Instantiate("VRTK Setup", transform.position, transform.rotation, 0);
          }
    }
    
    Then both players are in the scene and also enabled, but then each player controls two players at the same time (which is only visible in Unity, in the game this is not noticeable).
  • I have the same problem. If anyone find solution, can write here plz.