Search code examples
aframevirtual-reality

A-Frame: Cursor is fixed and not moving in VR


I use gazed based controls with the A-frame cursor component to navigate. While it works perfectly in my browser on desktop and mobile, the cursor is fixed and not moving in VR mode (not working on Google cardboard and neither with the Oculus browser or Firefox Reality).

Here's the code I use:

<a-camera>
  <a-cursor
    cursor="fuse: true; fuseTimeout: 2000"
    position="0 0 -1"
    geometry="primitive: ring; radiusInner: 0.01; radiusOuter: 0.02"
    material="color: red; shader: flat">
  </a-cursor>
</a-camera>

I use the following scripts in the head of my HTML:

<script src="https://aframe.io/releases/1.0.3/aframe.min.js"></script>
<script src="https://unpkg.com/aframe-event-set-component@5/dist/aframe-event-set-component.min.js"></script>
<script src="https://unpkg.com/aframe-layout-component@5.3.0/dist/aframe-layout-component.min.js"></script>
<script src="https://unpkg.com/aframe-template-component@3.2.1/dist/aframe-template-component.min.js"></script>
<script src="https://unpkg.com/aframe-proxy-event-component@2.1.0/dist/aframe-proxy-event-component.min.js"></script>

Solution

  • It’s a bug that has been recently fixed. It will ship in 1.0.4 but you can use master builds in the meantime:

    https://cdn.jsdelivr.net/gh/aframevr/aframe@130f5846ac7cb99dff0e30d703c15c046c066529/dist/aframe-master.min.js