Back to Aframe

wasd-controls

docs/components/wasd-controls.md

1.7.11.3 KB
Original Source

The wasd-controls component controls an entity with the WASD or arrow keyboard keys. The wasd-controls component is commonly attached to an entity with the camera component.

Example

html
<a-entity camera look-controls wasd-controls="acceleration:100" position="0 1.6 0"></a-entity>

Properties

PropertyDescriptionDefault Value
accelerationHow fast the entity accelerates when holding the keys.65
adAxisAxis that the A and D keys act upon.x
adInvertedWhether the axis that the A and D keys act upon are inverted.false
enabledWhether the WASD controls are enabled.true
flyWhether or not movement is restricted to the entity's initial plane.false
wsAxisAxis that the W and S keys act upon.z
wsInvertedWhether the axis that the W and S keys act upon are inverted.false