If you set a break point in your developer tools on that line, and then track the error stack, you’ll find out where error originates from.
In fact this is not an error, but just console.error log, which shall not break anything. So your app still works and you can add whatever logic to control your camera when there is no hmd available.
This error comes from the WebVR polyfill that we use to help support devices that don’t yet have full WebVR support. I haven’t looked into it in detail but I guess it’s trying to work out what your VR headset is and can’t figure it out because there is none attached.
Aside from showing a message on the screen, the error shouldn’t prevent anything from running.
You can also force VR enabled on all devices (even without the headset attached) in input_hmd.js there is a config at the bottom of the file.
WebVRConfig = {
// Forces availability of VR mode, even for non-mobile devices.
FORCE_ENABLE_VR: false, // Default: false.
MOUSE_KEYBOARD_CONTROLS_DISABLED: true
};
Hi Dave,
It’s not stopping anything from running, I just wanted a reliable way of detecting that a real HMD was connected so that if it wasn’t I could set the camera up.
Let me expand. In order for the room scale tracking to start up in the right place I normally put the camera at 0,0,0 . This is fine for the Vive but for the desktop it makes it hard to see the scene and what’s happening.
If I do it the other way around and set the camera to a specific position suitable for a desktop then when connected to a Vive the position of centre of the room scale moves to the camera position which is not ideal either.
So basically I need someway of detecting if room scale is in operation or not and set the camera appropriately.
Scratch that, didn’t work. It looks like as long as the vrCamera script is running on a desktop computer it positions the camera at 0,0,0 and pointing straight down.