Please remember that a-frame
renders the whole view on a <canvas>
, so you can't just use your mouse to click on any element inside the <a-scene>
.
If you want a simple gaze based cursor, you need to attach a cursor to the camera:
<a-camera>
<a-cursor></a-cursor>
</a-camera>
If You want to use the mouse, use the cursor component in the
<a-scene>
:
<a-scene cursor="rayOrigin:mouse">
If you want to use vive / oculus controllers, you should try
laser-controls
.
More details about properties and events regarding the cursor can be found in the docs.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…