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

Reading a button as an axis value no longer works #648

Open
tec27 opened this issue Oct 14, 2024 · 1 comment
Open

Reading a button as an axis value no longer works #648

tec27 opened this issue Oct 14, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@tec27
Copy link

tec27 commented Oct 14, 2024

Version

0.15.1, or current main ( 5bb37ff )

Operating system & version

Windows 11

What you did

  1. Run the axis_inputs example (cargo run --example axis_inputs)
  2. Press right trigger 2

What you expected to happen

The program should print the value of the trigger press depth

What actually happened

The program crashes:

thread 'Compute Task Pool (18)' panicked at C:\Users\Travis\.cargo\registry\src\index.crates.io-6f17d22bba15001f\leafwing-input-manager-0.15.1\src\action_state\mod.rs:594:14:
assertion `left == right` failed
  left: Button
 right: Axis
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `car_game::car::control_player`!
Encountered a panic in system `bevy_app::main_schedule::FixedMain::run_fixed_main`!
Encountered a panic in system `bevy_time::fixed::run_fixed_main_schedule`!
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!
error: process didn't exit successfully: `target\debug\car-game.exe` (exit code: 101)

Additional information

It looks like this assertion was added in: 5e90a7d

I'm not sure if the example needs to be updated to some alternative method (from looking through the docs I didn't see a great way of getting the button value at a higher level), or if this assertion isn't appropriate at this location.

@tec27 tec27 added the bug Something isn't working label Oct 14, 2024
@alice-i-cecile
Copy link
Contributor

This is a bug in the example, and intended to not work. The example should be checking the axis value explicitly.

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

2 participants