Search code examples
javascriptaframewebvr

How to enable gaze only for mobile VR mode


How to enable the gaze only for the mobile VR mode this the code that I tried but the gaze gets enabled mobile hand held mode also I do no that how to enabled gaze only for mobile VR please share some related snippets it'll be very helpful to me

Thanks in advance

var cursorEl = document.querySelector('a-cursor');
             if (!AFRAME.utils.device.isMobile()) {
             cursorEl.parentEl.removeChild(cursorEl.src);
           }


Solution

  • Remove the .src.

    cursorEl.parentEl.removeChild(cursorEl);