Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by qwertyk31 · Jul 09, 2013 at 03:51 AM · androidcontroller

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

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AlucardJay · Jul 09, 2013 at 05:47 AM 0
Share

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 :

  • http://docs.unity3d.com/Documentation/ScriptReference/Input.html

  • http://docs.unity3d.com/Documentation/$$anonymous$$anual/Input.html

avatar image qwertyk31 · Jul 09, 2013 at 05:53 AM 0
Share

$$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?

1 Reply

· Add your reply
  • Sort: 
avatar image
3

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 :

alt text

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





inputmanager.jpg (192.2 kB)
Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image amphoterik · Jul 18, 2013 at 01:34 PM 0
Share

+1, great post.

avatar image AlucardJay · Jul 25, 2013 at 07:33 AM 0
Share

Thank you =]

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

17 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges