dacha
    Preparing search index...

    Class KeyboardControl

    KeyboardControl component for handling keyboard input events.

    KeyboardControl component handles the keyboard input events for an actor. It can be used to bind keyboard events to game actions.

    // Create a keyboard control
    const keyboardControl = new KeyboardControl({
    inputEventBindings: [
    {
    key: 'KeyW',
    pressed: true,
    keepEmit: true,
    eventType: 'RUN',
    attrs: [
    {
    name: 'angle',
    type: 'number',
    value: 270,
    },
    ],
    },
    ],
    });

    // Add to actor
    actor.setComponent(keyboardControl);

    Hierarchy (View Summary)

    Index
    actor?: Actor
    inputEventBindings: InputEventBindings

    Input event bindings

    componentName: string