I am creating a game that has the option of local multiplayer, I’ve done it before, but using unity’s standard InputManager, but had several device recognition issues, sometimes forcing the player to restart the game.
So I want to use this new system that looks a lot better, but I’m facing some implementation problems. I will already configure the basic commands of the player, such as shoot, move … but when trying to start configuring the local cooperative mode I came across some problems.
A player may have multiple devices connected, I want to give him the option to choose which device will control his ship in the game and if that device is disconnected or he decides to use the keyboard during multiplayer, the game recognizes the change and changes the device. paired with that particular player.
I know this is possible in this new system, but I have no idea how to get devices connected and pair with a player via code, or how to detect if the player pressed a key from a device not paired with a player and pair. How do I do that?
- Get a list of connected devices
- Pick a device and pair with a particular player when he appears in the scene.
- Detect if an unpaired device is being used and pair with the player.
Already searched in forums, websites and youtube, found nothing.
Note: my english is not very good, sorry if that got confusing.