Replies: 1 comment 1 reply
-
You can disable an input action kind entirely by using the Essentially just initialize the resource with fn my_system(toggle_my_action_kind: Res<ToggleActions<MyActionKind>>) {
toggle_my_action_kind.enabled = false;
} I'm not sure if that will clear the input state or not, though, so you might have to test it out and see how it interacts. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have this in bevy_input_actionmap for basically nuking input state from orbit. Right now for instance I have Return bound to using powerups. Starting a game works fine because no player exists with the required components, but resuming a game always tries to launch/deploy a powerup because the bundle exists and the keybinding matches. Currently I'm using
release_all()
, but I'm guessing this doesn't quite wipe away everything.Also, I'm hitting the state transition issue where resuming my game from the start menu via Escape immediately pauses the game because it resumes, then leafwing-input-manager detects that Escape was just pressed and re-pauses. I can only resume the game by pressing Enter on the Resume button, which again launches a powerup.
Is there a way for me to aggressively clear input state on certain transitions?
Thanks again.
Beta Was this translation helpful? Give feedback.
All reactions