Any idea on how to add a gamepad to a game?

i am working on a 2 player splitscreen game and have 2 ideas.
A) assign a new camera control sequence (instead of mouse it uses keys for up down left and right)
B) use gamepads (controllers) for both players.
any ideas on how to add input controls for both? or at least one player?
https://playcanvas.com/editor/code/691128?tabs=44103147
https://playcanvas.com/editor/scene/1070381

For that check my example code here:

I am not sure how a single gamepad can be used by both players :slight_smile:

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:

1 Like