Skip to main content
New Participant
March 24, 2015

photonNetwork.instantiate

hi guys i hope you can help me out
Im creating a ovr multiplayer using photon network, Im trying to instantiate the OVRCameraRig prefab that is in the resources directory.
Im using:
PhotonNetwork.Instantiate ("OVRCameraRig",Vector3.zero,Quaternion.identity,0);


when i build the project , the ovr cam seems to be black, its the only cam in the game, and when i use regular camera object it working fine

thanks in advance for the help

Gal
    This topic has been closed for replies.

    12 replies

    Participant
    April 7, 2015
    I have the exact same problem as you. (Edit*: In Unity 5, this problem does not exist in Unity 4.6.4)

    Just to be clear: Instantiating either the OVRPlayerController or OVRCameraRig with PhotonNetwork.Instantiate will cause the Direct to Rift build to render the cameras output as black. However, the OVRCameraRig is actually instantiated and does show up across the network if viewed from the editor. Testing the scene in the Editor or with the normal .exe will work, and the cameras will render properly. It seems to only effect the Direct to Rift build.

    Is this happening to anyone else?
    New Participant
    April 7, 2015
    Yes! This is happening to my group as well for a group project and has been working fine until we switched to Unity 5. Very frustrating.
    New Participant
    April 7, 2015
    It also appears to be windows only.
    Inspiring
    April 7, 2015
    Is there more than one OVRCameraRig in your scene? Try disabling the first one before you instantiate the second one. If you need both active at once, disable their OVRManager components and make a third GameObject with OVRManager on it. There can only be one OVRManager in the scene at any given time. You might also want to set DontDestroyOnLoad on that one to make it persist between scenes.
    New Participant
    April 7, 2015
    Hey vrdaveb! Thanks for getting back to us.

    4.6.4 seems to work with destroying and instantiating as you are suggesting. 5.0 and higher makes the image in the oculus itself freeze up, but still works fine if you view the camera through the editor. I don't mean to be dismissive at all, with your suggestion, but it did work in 4.6.4 previously so I don't particularly know if the OVRManager is causing it. Using DontDestroyOnLoad is an issue when you are creating a lobby based multiplayer game, so one instance isn't really something that we can work with :/
    New Participant
    April 7, 2015
    Also, as I mentioned previously it works on Mac's but does not work on Windows machines (tested on three seperate macs and three seperate PC's. Both desktop and laptop) which makes me think this is a problem not on our end.
    Participant
    April 7, 2015
    Unity 5.0.0f4 Personal (Have tested it on Professional with the same results).
    Latest Oculus Runtime, with the latest Oculus Unity Integration (I tested this with one version back for both, same result)

    This is a barebones project that only instantiates a single OVRCameraRig, with no OVRCamerRig existing in the scene prior to instantiating. The only thing this project attempts to do is instantiate the OVRCamerRig. The only objects existing in the hierarchy are:
    _SCRIPTS
    Directional Light
    Plane

    If I press play in the editor, the OVRCameraRig (or OVRPlayerController) will be instantiated properly and both cameras are displayed properly in the Game view. If I build this scene and launch the normal .exe the Rig is instantiated properly and both cameras are displayed properly. If I launch the direct to rift .exe I get a black screen.

    For the time being I have decided to use Unity 4.6.4 until there is a fix.
    Inspiring
    April 7, 2015
    Can you share the project files so I can try myself?
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Participant
    April 8, 2015
    I have shared the file in a PM, with instructions.

    Thank you very much for looking into this for us.
    April 8, 2015
    Why are you instantiating the OVRRig over Photon in the first place?
    Are you trying to send its transform or something?
    Why not photon instantiate an empty prefab and parent it to each players reguarly instantiated OVRRig?
    Maybe i'm missing something here but I can not think of why you would ever want to photon instantiate an OVRRig.