Forum Discussion
galshal
11 years agoHonored Guest
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:
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
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
12 Replies
Replies have been turned off for this discussion
- TindajiiHonored GuestI 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? - AertyrHonored GuestYes! 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.
- AertyrHonored GuestIt also appears to be windows only.
- vrdavebOculus StaffIs 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.
- AertyrHonored GuestHey 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 :/ - AertyrHonored GuestAlso, 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.
- TindajiiHonored GuestUnity 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. - cyberealityGrand ChampionCan you share the project files so I can try myself?
- TindajiiHonored GuestI have shared the file in a PM, with instructions.
Thank you very much for looking into this for us. - MiLO83Honored GuestWhy 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.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 4 years ago
- 11 years ago