Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input mocking is somewhat broken by Bevy 0.12 #407

Open
alice-i-cecile opened this issue Nov 4, 2023 · 0 comments
Open

Input mocking is somewhat broken by Bevy 0.12 #407

alice-i-cecile opened this issue Nov 4, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@alice-i-cecile
Copy link
Contributor

          Did some more searching and I think I found the root of the problem! The issue is only with input mocking, or more specifically, sending inputs by events. Before the mentioned pr, `gamepad_button_event_system()` changed the `Axis<GamepadButton>` resource from events send by `bevy_gilrs`.

https://github.com/bevyengine/bevy/blob/756fb069b10c14bf06cc4ab07d0fce1e80fc559d/crates/bevy_input/src/gamepad.rs#L1178-L1211

https://github.com/bevyengine/bevy/blob/756fb069b10c14bf06cc4ab07d0fce1e80fc559d/crates/bevy_gilrs/src/gilrs_system.rs#L29C1-L35C4

After the pr, bevy_gilrs updates the resource directly and doesn't receive any bevy_input gamepad events, hence why input mocking for an axis button fails but the example works.

So now the only remaining question is, "what is the proper way to fix this?" Maybe reverse the part in the pr where reading EventReader<GamepadButtonChangedEvent> to set ResMut<Axis<GamepadButton>> in bevy_input was removed? I don't know how this would affect the changes from that pr though.

Originally posted by @100-TomatoJuice in #401 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant