1. I opened an extra thread for the “Hmd Not Found” error message here .
2. I now change the menus depending on if there’s a WMR headset connected or not:
Default:
- MainCamera: Solid color, Culling Mask: everything except UI, depth: 0, at (0,0,0)
- UICamera: Depth only, Culling Mask: only UI, depth: 1, at (0,0,0)
- Canvas: “Screen Space - Camera” that uses the UI camera, at (0,0,100) because of “plane distance = 100”
VR:
- Cameras are the same
- Canvas:
if(vrmodeenabled) {
canvas.renderMode = RenderMode.WorldSpace; //switch to WorldSpace
canvas.transform.position = new Vector3(0,0,200); //move the canvas back a bit
}
This keeps the menus in a specific spot (instead of moving them with the camera like in non-VR mode), so you can look around without them moving with you. It also keeps the menus in front of everything (even if they should be behind something for correct visibility).
If the player can move around, you have to move the menu to “(player.x, player.y, player.z+200)” of course and rotate it accordingly (e.g. for a pause menu that’s always in front of the player).
Also noteworthy: Looking around using a VR headset makes the UI camera rotate twice as fast as the MainCamera - I posted a fix in my thread here .
3. How does everyone do that? I tried detecting and changing it automatically but that keeps looping me back to the “Hmd Not found” problem (check the thread I linked for 1.).