Skip to content

Commit

Permalink
Add set_gamepad() doc
Browse files Browse the repository at this point in the history
  • Loading branch information
100-TomatoJuice committed Sep 16, 2023
1 parent e4488ad commit 33c6231
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/register_gamepads.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Demonstrates how to register gamepads in local multiplayer fashion
use bevy::{prelude::*, utils::HashMap};
use leafwing_input_manager::prelude::*;

Expand Down Expand Up @@ -55,6 +56,8 @@ fn join(
input_map: InputMap::default()
.insert(GamepadButtonType::South, Action::Jump)
.insert(GamepadButtonType::Select, Action::Disconnect)
// Make sure to set the gamepad or all gamepads will be used!
.set_gamepad(gamepad)
.build(),
})
.insert(Player { gamepad })
Expand Down

0 comments on commit 33c6231

Please sign in to comment.