Hi,
I am trying to create an Hybrid app between VR and non VR modes. I want to detect when a headset is disconnected / connected to switch between standard and VR mode.
I think I have the headset detection working. But I can’t figure out a way to stop the rendering to the headset and tell Unity to start a normal rendering. (I mean when the headset is disconnected the unity game window don’t want to switch camera to the standard camera, and stays on the last picture sent to the headset).
Anyone can help me with this ?
Thanks
Can’t you just disable the camera component on the headset and pc on the right moments?
And then the only active camera should display on the monitor, so just have 2 ‘players’
I tried. But none of the camera gets updated if the headset is disconnected. It’s like the game is paused or something.
What kind of gameobject is the second camera? Is it inside of the player gameobject which is in vr?
The VR camera is the camera on the default XR Rig game object.
The other camera is on another game object not related to the VR.
The games objects are never enabled at the same time. But if the headset is disconnected (the headset has it’s screen off for example).
Maybe attach some screenshots to explain what you have done so far. At least a screenshot showing the settings of the Camera that doesn’t work.
On the first picture, the headset is disconnected at launch so XR fails to start. Here the non VR camera is working. (I can’t click on the button for some reason but I don’t think it’s a major issue for now).
On the second picture, the headset is connected at lauch, XR is started and the VR view is displayed. The non VR camera is disabled (the “Desktop Manager” object).
On the third picture, the headset is disconnected after it was previously connected. The VR camera is disabled (Inside the “VR Manager” object, that contains XR Rig with a camera) and the non VR camera is enabled (the "Destop Manager’ object).
Here the camera is not displayed int the game view, and the camera view is visible in the editor.
Some things to note :
- If I stop the XRDisplaySubsystem with XRDisplaySubsystem.Stop() nothing happen
- If I destroy the XRDisplaySubsystem with XRDisplaySubsystem.Destroy() the non VR camera is diplayed again. But I get internal errors on the XR plugin during it’s internal event update queue. I can’t use XR anymore.
- If I disable the XR plugin the non VR camera is displayed again. I can get the VR to work again by manually restarting the plugin.