unity-game-enginegamepadgamecontroller

Can I use multiple Gamepads with Unity3d?


I have a couple questions about Unity3d and Game Controllers on PC.

In Unity3d is it possible to use a game pad as an input source? If so, which game pads are supported (e.g. Xbox)? Do I need a plugin or someone else's code? Can I use the vibration?

Can I recieve input from multiple game pads at the same time (co-op for up to 4 players on same machine)?

I have looked several places, and it seems that using XInput will allow for Xbox controller support in Unity on Windows. I have seen nothing on multiple controller support (e.g. 2-4 controllers on the same PC). Thank you so much for your time!


Solution

  • You can get input of a specific joystick using this

    Joystick Buttons (from a specific joystick): “joystick 1 button 0”, “joystick 1 button 1”, “joystick 2 button 0”, …

    http://docs.unity3d.com/Manual/ConventionalGameInput.html

    Near the end of the page