New Input System: Configure rumble on a specific gamepad?

Hi there,

I have just been reading through the documentation on the new Input System 1.0 and have started implementing it into my local multiplayer project. I noticed that there is a way to set the motor speeds using :

Gamepad.current.SetMotorSpeeds(low freq, high freq);

As I am using multiple gamepads I am wanting to single out a specific gamepad related to that player and only produce rumble for that gamepad. When I use the above, it produces rumble on all connected gamepads.

Apologies if ive overlooked something, but if anyone could point me in the right direction that would be great.

Thanks!

1 Like

It depends. But something like this:

// Mark gamepad #2 as being for player 1.
InputSystem.SetDeviceUsage(Gamepad.all[1], "Player1");
// And later look it up.
var player1Gamepad = InputSystem.GetDevice<Gamepad>(new InternedString("Player1"));

And then you can use the player1Gamepad instead of the Gamepad.current.

More info and more possibilities here: Class InputSystem | Input System | 1.0.2

2 Likes

Exactly what ive been looking for, thanks for the help!

1 Like

gamepad = playerInput.GetDevice();

this works for local multiplayer