当前位置: 首页 > 文档资料 > A-Frame 中文文档 >

wasd-controls

优质
小牛编辑
132浏览
2023-12-01

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

            
              <
                a-entity
                camera
                look-controls
                wasd-controls>
              </
                a-entity>
          

Properties

PropertyDescriptionDefault Value
accelerationHow fast the entity accelerates when holding the keys.65
adAxisAxis that the Aand Dkeys act upon.x
adInvertedWhether the axis that the Aand Dkeys act upon are inverted.false
easingHow fast the entity decelerates after releasing the keys. Like friction.20
enabledWhether the WASD controls are enabled.true
flyWhether or not movement is restricted to the entity’s initial plane.false
wsAxisAxis that the Wand Skeys act upon.z
wsInvertedWhether the axis that the W and S keys act upon are inverted.false