Skip to content

Commit

Permalink
Fix gamepad connection system ordering (bevyengine#4313)
Browse files Browse the repository at this point in the history
# Objective

- Part of the splitting process of bevyengine#3692.

## Solution

- Change the `gamepad_connection_system` to run after the `InputSystem` label.

## Reasons

I changed the `gamepad_connection_system` to run after the `InputSystem` instead of in parallel, because this system checks the `GamepadEvent`s which get send inside of the `gamepad_event_system`. This means that the `gamepad_connection_system` could respond to the events one frame later, instead of instantly resulting in one frame lag.

Old possible case:
1. `gamepad_connection_system` (reacts to the `GamepadEvent`s too early)
2. `gamepad_event_system` (sends the `GamepadEvent`s)

New fixed ordering:
1. `gamepad_event_system` (sends the `GamepadEvent`s)
2. `gamepad_connection_system` (reacts to the `GamepadEvent`s)
  • Loading branch information
KDecay authored and ItsDoot committed Feb 1, 2023
1 parent 522c195 commit 09d81f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_input/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl Plugin for InputPlugin {
)
.add_system_to_stage(
CoreStage::PreUpdate,
gamepad_connection_system.label(InputSystem),
gamepad_connection_system.after(InputSystem),
)
// touch
.add_event::<TouchInput>()
Expand Down

0 comments on commit 09d81f3

Please sign in to comment.