Demonstration of how to lock a device to a user with the InputSystem and PlayerInput component.
This is aimed at a single player game and targeting console, but will work just as well for PC.
- Open the SampleScene and enter play mode.
- You will be greeted with the player engagement screen, press A button on gamepad or SPACE on keyboard.
- You can move the sprite with left thumbstick for gamepad or WADS on keyboard.
This example will respond to device lost events in the case a gamepad becomes disconnected.
It will then wait for a reconnection (eg; replace batteries), or add a new gamepad and associate to the InputUser.
It will also unpair all devices from the InputUser so during gameplay, input is only sent from the main paired device.
Please by all means add to this example and enhance the functionality!