For that check my example code here:
I am not sure how a single gamepad can be used by both players 
Here is a controller that has multiple input handlers (mouse, touch, keyboard and gamepad):
https://playcanvas.github.io/#camera/first-person.html
The code for the camera script is here:
https://github.com/playcanvas/playcanvas.github.io/blob/master/scripts/camera/first-person-camera.js
1 Like