Search Unity

Mixing VR and non VR in multiplayer (UNET)

Discussion in 'UNet' started by Korno, Jan 10, 2017.

  1. Korno

    Korno

    Joined:
    Oct 26, 2014
    Posts:
    518
    Hey guys,

    I am using the HLAPI and having a mixed VR and non VR multiplayer. Basically, there is a VR player and single observer who is non VR.

    I can spawn different player prefabs for them, that is not a problem. The host will always be non VR so I can detect the host and then spawn the correct observer player prefab. I also can detect when the player is a client, hence the VR player and spawn the prefab containing the OpenVR stuff. But how do I enable VR at that moment? Is there some switch that I can turn on to tell Unity to start VR rendering? It doesn't seem to automatically.

    (Also not sure if this should be in networking or vr forum)
     
  2. KyleOlsen

    KyleOlsen

    Joined:
    Apr 3, 2012
    Posts:
    237
  3. hky_bmt

    hky_bmt

    Joined:
    Oct 7, 2015
    Posts:
    1
    I'm having the same problem. I'm using Unity 5.6.0f3. I make sure to write a script which disables VR on awake for non-vr players. Even if I disable VR in build settings, it feels like the fact that the SteamVR plugin exists in the project, this just gets reset no matter what
     
  4. hellaeon

    hellaeon

    Joined:
    Jul 20, 2010
    Posts:
    90
    Unsure if you found a solution to this but I can tell you what I do for local multiplayer and VR. I have a sports game where the one of the players is watching via a normal non VR camera. The other player plays in VR. This way the non vr player has their view which is more of a typical sports games view, whereas the VR player is on the field, obviously 'in the action'

    That is how I did it. Multiple cameras in the scene. If you detect the non player, just get them to use a normal camera....

    Yeah I know, sounds so easy right, I am learning online multiplayer at the moment and trying to work it with VR...