How to implement local multiplayer

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By SkyRodent

I want to have it so that two people can join the game at once with the same controllers. I want it so that if two people had for example two snes controllers that could connect to a computer they could control two different characters with the same input just on different controllers. I’ve watched tutorials but they always have one person using the keyboard and the other using a game pad. I want something like how ps4 or Xbox does it with local multiplayer, splitscreen. My version of Godot is 3.2.1 stable

:bust_in_silhouette: Reply From: Coxcopi

Hey !

You can set controll up in the Input Manager, and you can also choose the device index for the Action. So if you have for example two xBox Controllers, one of them has the index (The index is like the Number of the Controller) 0 and one has the index one.

You can then set up actions for the Controller 0 and set the same actions up for the Controller 1. Now you can use them in your code.

(Naming them accordingly really helps in this case, e.g ‘snes_1_forward’ and ‘snes_2_forward’)

Thank you that worked!

SkyRodent | 2020-08-03 12:39