When I add
<a-scene
cursor="rayOrigin: mouse;"
raycaster="objects: .rayclick;"
>
and
<a-entity id="clickabl1" class="rayclick" rayclick>
and
AFRAME.registerComponent('rayclick', {
init: function () {
this.el.addEventListener('click', (evt) => {
alert(`I was clicked at ${this.el.id}`);
});
}
});
I end up with a strange situation... seemingly, the code does nothing, no click functionality at all--except, when I open the aframe inspector, suddenly it works perfectly. Then, when I close the inspector, back to nothing working.
What could this possibly mean?