I’m making a couch co-op game and already have working multiplayer.
I can not get “gamepad.righttrigger.waspressedthisframe” to work for the 2nd player, works for the 1st.
My hope was to make unique Gamepad references and call “waspressedthisframe” through them.
But “Gamepad.current” does not seem to give me a reference to each player’s unique gamepad.
Does anyone know how to reference the unique gamepad attached to a player?
P.S. this was not helpful (How do I…? | Input System | 1.0.2)
My code attempt though I doubt it will make sense:

Cheapest way is to do
Gamepad gamepad = Gamepad.all[index];
ok let me try an index. will check back
Thanks for your help @print_helloworld I tried what you wrote above and the debug still gave me the same read out as before: different index per player, same controller
I think I need to find all gamepads, add them to a list, and then pair the players with controllers as I iterate the gamepad list. I’ll try to see if I can do that tomorrow.
so I seemed to have correctly added my gamepads to a list.
in the debug the list has 2 objects added to it when I’m playing with two controllers
however my goal: “myGamepad.buttonEast.wasPressedThisFrame” still does not work
there should be away to use this function with more than one controller correct?
@print_helloworld do you have any other ideas?
void Start()
{
playerInput = GetComponent<PlayerInput>();
var players = FindObjectsOfType<Player>();
var index = playerInput.playerIndex;
playerScript = players.FirstOrDefault(m => m.GetPlayerIndex() == index);
var gamepads = new List<Gamepad>();
foreach (Gamepad uniqueGamepad in Gamepad.all)
{
gamepads.Add(uniqueGamepad);
Debug.Log(gamepads.Count);
}
if (index == 0)
{
p1Gamepad = gamepads[0];
myGamepad = p1Gamepad;
Debug.Log("My index is: " + index + " // My gamepad is: " + myGamepad);
}
if (index == 1)
{
p1Gamepad = gamepads[1];
myGamepad = p1Gamepad;
Debug.Log("My index is: " + index + " // My gamepad is: " + myGamepad);
}
}
public void OnEast(CallbackContext context)
{
if (playerScript != null)
{
if (myGamepad == null)
{
Debug.Log("no gamepad");
}
else
{
if (myGamepad.buttonEast.wasPressedThisFrame)
{
playerScript.TestPressed();
}
if (myGamepad.buttonEast.wasReleasedThisFrame)
{
playerScript.TestReleased();
}
}
}
}