Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable keyboard or WASD controls in A-Frame?

Tags:

aframe

How to disable the keyboard controls for the camera in the default scene?

<a-scene></a-scene>
like image 873
ngokevin Avatar asked Jan 13 '17 13:01

ngokevin


1 Answers

The wasd-controls component is attached to the default camera by default. You can either:

Define <a-camera> with wasd-controls disabled to override the default one:

<a-scene><a-camera wasd-controls-enabled="false"></a-camera></a-scene>

Or remove it with removeAttribute (when the scene is ready):

document.querySelector('[camera]').removeAttribute('wasd-controls');

Or define a raw camera without wasd-controls:

<a-entity camera="userHeight: 1.6" look-controls></a-entity>
like image 191
ngokevin Avatar answered Nov 03 '22 08:11

ngokevin