cancel
Showing results for 
Search instead for 
Did you mean: 

Unity Camera Preview different than Rift view (bug?)

drohack
Explorer
I'm making a multiplayer Unity game using Photon Unity Network to handle the multiplayer. I can re-create this issue by making a Room with one player (P1) (their camera loads into position and rotation correctly, even if they load in off kilter). Then a 2nd player joins the Room (P2), but they load in with their Rift pointing at an odd angle (physically pointing the HMD off center or even sideways) (not straight forward and level). Their "center" for their camera will be that off kilter view instead of a level view. I have no idea why this is.
(I'm able to re-create this on my own computer starting up 2 versions of my game. And on 2 separate computers loading the game with 2 HMDs.)

There is only one OVRManager in the scene (each player loads in their own, but the OVRManager is not networked). The other players only load in the graphics of their player Avatar with their camera disabled so there isn't any conflicts.

What I find odd is that if I do this in the Unity editor and I click on the P2 active CenterEyeCamera the "Preview" for that camera is correct and level, but what's piped out to the Game Window and Rift is off kilter. Even the CenterEyeCamera rotation is level. It's like it got off sync somehow with the camera in game.

Is there any way to access what the camera is outputing to the Rift and get that object's rotation? Or manually recenter (other than UnityEngine.VR.InputTracking.Recenter(); as this just puts the CenterEyeCamera back to where it should be, but doesn't fix the off kilter output). Would it be better to manually add the Camera onto the CenterEyeCamera rather than just disabling/enabling? Or is there some special magic that Unity and the Rift do to get it to output to the Rift display that's embedded into that camera's settings (i.e. what settings do I need to set for a camera object)?

Apologies for the vague questions, but I'm not sure how else to debug this issue.
2 REPLIES 2

drohack
Explorer
I think I may have found a solution, but I'm not entirely sure why. I was originally enabling and adding in the OVRManager and OVRCameraRig scripts on the Awake() function of instantiating my Player object. I move that code to the Start() function and it seems to have fixed the issue. I haven't done much testing so I'm not entirely sure, but it seems to have helped at least... 

drohack
Explorer
This issue has cropped back up (I haven't updated Unity or anything, but I have added extra plugins to the game)... Not sure why.

This gentleman also is explaining the issue better on this thread (who is also having the same issue): https://forums.oculus.com/developer/discussion/43870/instatiating-player-with-ovrcamerarig-is-tilted-unity