Skip to content
Advertisement

Disable the drag on screen in a-frame AR.js

I am trying to disable the drag feature of A-frame so that if a object is in front of your screen the user can’t just drag on the screen and remove it from your front to other place without even moving.

Can anyone help me out with how I can do it?

EDIT

I have already tried look-controls-enabled="false", but it also binds the 3d-object to the screen i.e. when we turn the phone to different direction the 3d-object also gets stuck to the screen and moves with us.

Is there a way to only disable the touch-drag operation performed by fingers only?

Advertisement

Answer

According to the documentation, you can set the look-controls “touchEnabled” property to false, it should solve your issue.

https://aframe.io/docs/1.0.0/components/look-controls.html

It should do with something like this

<a-camera camera="fov: 80;" id="camera" rotation-reader position="0 1.6 16" listener look-controls="reverseMouseDrag:true; touchEnabled: false">
</a-camera>
Advertisement