- Home /
Changing first person controller to work with Ouya
I have looked through the scripts in the first person controller from the standed assets but can't find where it says what keys do what I need to get it to work with the Ouya's analoge sticks. docs for the Ouya's controller can be found here if it helps https://devs.ouya.tv/developers/docs/controllers
I'm assu$$anonymous$$g it's the exact same thing as the current Unity input class. OUYA is just an Android build, no?
$$anonymous$$ake a test like this : http://www.alucardj.net16.net/JoystickTest/JoystickTest.html
Build it, put it on the console, see if all the buttons show up. It's all in the API for Input :
$$anonymous$$y main problem is I dont know what part of the script to change. in the pc/ mac vertions you can pick you own keys. can you do this with android?
Answer by AlucardJay · Jul 09, 2013 at 07:17 AM
You are missing the point.
All the types of input are handled with the Input Manager : http://docs.unity3d.com/Documentation/Manual/Input.html
You set up axis and button inputs for each controller : Joystick Buttons (from a specific joystick): "joystick 1 button 0", "joystick 1 button 1", "joystick 2 button 0", ...
you build a test project, to check if the inputs are working : eg http://www.alucardj.net16.net/JoystickTest/JoystickTest.html
For example :
Input Manager Settings :
Script :
function TriggerInputs()
{
var offset : float = 1.5;
// - Triggers -
if ( Input.GetAxis( "Left Trigger" ) > 0.02 )
{
leftTrigger.position.y = leftTriggerStartPos.y + ( offset * Input.GetAxis( "Left Trigger" ) );
SetRendererColour( leftTrigger.renderer, selectedColour );
}
else
{
leftTrigger.position.y = leftTriggerStartPos.y;
SetRendererColour( leftTrigger.renderer, defaultColour );
}
if ( Input.GetAxis( "Right Trigger" ) > 0.02 )
{
rightTrigger.position.y = rightTriggerStartPos.y + ( offset * Input.GetAxis( "Right Trigger" ) );
SetRendererColour( rightTrigger.renderer, selectedColour );
}
else
{
rightTrigger.position.y = rightTriggerStartPos.y;
SetRendererColour( rightTrigger.renderer, defaultColour );
}
}
function BumperInputs()
{
// - Left Bumper -
if ( Input.GetButton( "Left Bumper" ) )
{
SetRendererColour( leftBumper, selectedColour );
}
else
{
SetRendererColour( leftBumper, defaultColour );
}
// - Right Bumper -
if ( Input.GetButton( "Right Bumper" ) )
{
SetRendererColour( rightBumper, selectedColour );
}
else
{
SetRendererColour( rightBumper, defaultColour );
}
}
By the way, don't use my inputs, for the OUYA you'll need to setup an input for each joystick , eg :
joystick 1 button 5
joystick 3 button 1
etc etc
Your answer
Follow this Question
Related Questions
I Trying to Make a Game for my OUYA 0 Answers
Swipe Android 1 Answer
Bluetooth controller works in the editor but not on a android device 0 Answers
Controller (like in Angry Bots) for smarthphones for free on C#?? 1 Answer
Help with Android Joysticks 0 Answers