til input run conditions

sometimes you don't even need an input manager

2024-09-20
#bevy

Leafwing Input Manager is great. But for quick examples or simple needs, turns out you can hook up a system directly to an input run codition.

    app.add_systems(
        Update,
        do_thing_on_space.run_if(input_just_pressed(KeyCode::Space)),
    )
    .add_systems(
        Update,
        do_thing_on_enter.run_if(input_just_pressed(KeyCode::Enter)),
    );

Cool.