Hey all, I am trying to set my game up support the Ouya, Xbox360, and PS3 controller universally. The issue that I am running into is each controllers button mapping. I'm NOT using legacy controls, just the standard unity input manager. The issue we are running into is that button 13 for instance is the right trigger on the Ouya controller, button 13 is the left thumbstick in on the 360 controller. Is there a way to detect controller types, or some way to make each contoller plugged into the Ouya map the same as the Ouya button mapping? Thanks all.
This will return you a list of the names of all controllers currently hooked up to the OUYA, in order of controller index. Then just match the name to the index of the controller you are detecting input from.
Thank you Dreamwriter. Here is what I've come up with. Am I on the right track here?
for (var i : int = 0; i <playerCount; i++){
if(i == 1){
p1JoystickName = Input.GetJoystickNames()[i];
}else if(i == 2){
p2JoystickName = Input.GetJoystickNames()[i];
}
}
This would of course go on for however many players were in my game. Inside of each gameobject I could then assign the correct inputs by comparing the strings like this :
Comments
This will return you a list of the names of all controllers currently hooked up to the OUYA, in order of controller index. Then just match the name to the index of the controller you are detecting input from.
http://docs.unity3d.com/Documentation/ScriptReference/Input.GetJoystickNames.html
OUYA Inc | Android Developer
Skype: tgraupmann_prey
http://github.com/ouya/docs
http://github.com/ouya/ouya-sdk-examples
Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]
Use caution when setting [persistent wireless mode].