Normal Programming Mistake


    0.2.0 • Public • Published

    A-Frame locomotion

    A collection of A-Frame components, systems and primitives that enable all sorts of locomotion in VR. It't built to be modular, flexible and easy to use. Currently supports smooth locomotion, snap turning and smooth turning. Besides the actual modes of locomotion, there are auxillary components to improve the locomotion experience like a vignette when moving, fading when snap turning and more.

    Try the online examples Aframe locomotion example

    Blog post describing the implementation: A-Frame Adventures 01 - Smooth locomotion and snap turning

    Buy Me a Coffee at

    Quick start

    To add aframe-locomotion to your A-Frame project, all you have to do is load the aframe-locomotion javascript:

    <script src=""></script>

    This will automatically register the components smooth-locomotion and snap-turn. These need to be attached to the controllers as part of a camera rig, as follows:

    <!-- Camera rig -->
    <a-entity id="rig" position="0 0 0">
        <a-entity id="camera" camera position="0 1.6 0" wasd-controls look-controls></a-entity>
        <!-- Hands -->
            vive-controls="hand: left"
            oculus-touch-controls="hand: left"
            locomotion="target: #rig; reference: #camera">
            vive-controls="hand: right"
            oculus-touch-controls="hand: right"
            snap-turn="target: #rig; reference: #camera">

    Both smooth-locomotion and snap-turn have more properties that can be used to tweak the behaviour. Check the Documentation to learn more or explore the examples.


    • Smooth locomotion
    • Snap turning (with optional fade transitions)
    • Smooth turning
    • Vignette when moving
    • Nav-mesh support

    Planned features

    • [ ] Velocity effectors (e.g. conveyor belts, moving platforms)
    • [ ] Smooth snap turning
    • [ ] Momentum preservation
    • [ ] Teleport
    • [ ] Flying
    • [ ] Head-collision prevention


    If you've got any questions, feedback, suggestions or even want to help out, feel free to reach out to me.


    npm i aframe-locomotion

    DownloadsWeekly Downloads






    Unpacked Size

    31.7 kB

    Total Files


    Last publish


    • mrxz