Function bevy::input::common_conditions::input_just_pressed
source · pub fn input_just_pressed<T>(
input: T
) -> impl FnMut(Res<'_, ButtonInput<T>>) + Clone
Expand description
Run condition that is active if ButtonInput::just_pressed
is true for the given input.
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(Update, jump.run_if(input_just_pressed(KeyCode::Space)))
.run();
}