Search code examples
javascriptaframewebvr

how to add touch controls in aframe


How to add touch controls for mobile and mouse click for desktop in aframe.I am getting confusing with this part in aframe is there any help?

Thanks


Solution

  • Try using the mouse-component, the raycasts emitted from the mouse clicks seem to work as well with mobile touch events.


    Note, that You may run into multiple issues when You use the a cursor, and the mouse-cursor-component simultaneously. For example it is possible to make a double click ( one with the component, second with the cursor ).