aframe - make <a-cursor> follow mouse on desktop
<p>UPDATE: problem solved by this plugin <a href="https://github.com/mayognaise/aframe-mouse-cursor-component" rel="nofollow noreferrer">https://github.com/mayognaise/aframe-mouse-cursor-component</a></p>

<p>New to aframe here. I am creating a scene where I want the user to be able to "click" on objects on desktop browser and I did not want to go great lengths to mess with the existing look-controls code or create a new component, so I looked at code from <a href="https://stackoverflow.com/a/36071100/5132437">https://stackoverflow.com/a/36071100/5132437</a> and devised a solution where I try to make the position of the  follow the movement of mouse: </p>

<pre><code>// code for moving the cursor
var mouse = {
  x: 0,
  y: 0
};
var camera = document.querySelector('#camera').components.camera.camera;
console.log(camera.position);

function onMouseMove(event) {

  mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
  mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;

  var vector = new THREE.Vector3(mouse.x, mouse.y, -1);
  vector.unproject(camera);
  var dir = vector.sub(camera.position).normalize();
  var distance = -camera.position.z / dir.z;
  var pos = camera.position.clone().add(dir.multiplyScalar(distance));
  positionStr = String(pos.x) + " " + String(pos.y) + " " + String(pos.z);
  document.querySelector('#cursor').setAttribute('position', positionStr);
}

window.addEventListener('mousemove', onMouseMove, false);
</code></pre>

<p>The problem here is that every time the mouse moves the cursor disappears to position (0,0,0). I understand there might be a problem with getting the correct camera data in a-frame but I'm not sure. </p>

<p><a href="https://jsfiddle.net/qoqwnhhz/" rel="nofollow noreferrer">Full jsFiddle here</a></p>

<p>Any help would be appreciated</p>