Skip to main content

attach_press_timer

Function attach_press_timer 

Source
pub fn attach_press_timer(
    commands: Commands<'_, '_>,
    just_pressed: Query<'_, '_, Entity, (With<Pressed>, Without<PressStartedAt>)>,
    just_released: Query<'_, '_, Entity, (With<PressStartedAt>, Without<Pressed>)>,
)
Expand description

Maintain PressStartedAt: attach on first frame an entity carries Pressed without a timer, remove when Pressed disappears.