hey folks i’ve got a situation in a course i’m teaching where myself or my students may be using the Editor both in Standalone Mode and also in VR. the new XR Toolkit and Input system manage the switch off very well which is more convenient than the VRTK method of completely different rig setups. so visually the Editor mode without VR and with VR are pretty close to each other in terms of look and feel in the Game View but there’s still some issues i’d like to tweak visually if the VR HMD and controllers are present or if not it falls back to standard Desktop layout and disables the controller objects.
anyway, how do you check if the HMD and controllers are present or not via a simple flag at startup in a script? alternately is there a way to check the XR plugin settings from a script to see if any are active? i’m in Unity 2020.1 BTW. thanks in advance!
You can’t really check if the HMD is present without starting VR, but you can use the MockHMD to switch between XR and Non-XR more easily than using an actual headset.
That returns not-null, even with headset is not connected.
Still searching for a way to detect whether to start VR or PC mode… (if no headset is connected)
In steamvr its pretty much automatic, you get one error that hmd not found, and you are in PC mode.