• 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 /
avatar image
0
Question by bilek993 · Aug 13, 2015 at 04:47 PM · androidtv

Android TV controller

Hello,

I have got a problem with distribution on the Play Store for Android TV. I got rejected every time I tried, because my game didn't met requirements for the controller. Email from google:

Your game is inaccessible with a standard Android game controller. We are unable to navigate left or right within the menus of your game. Please make sure all menus and options are fully functional using the game controller.

Ok, then so I doesn't work with their controller, but what I did wrong? I wasn't able to find how to configure controller for Official Android TV, so I used this from amazon. Anyway I see that this is not the same and I can't pass through google.

Here is my question how to configurate android inputs to pass throught google veryfication?!

BTW. Here is my game -> LINK, you can check it out on your Android TV and tell me what doesn't work...

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by GameDev_Chuck · Dec 08, 2015 at 12:18 AM

I just figured this out a couple hours ago. In the Event System, there's a 'Standalone Input Module' script. At the bottom of that script in the inspector there's a bool option (check box) called 'Allow Activation on Mobile'... Checking this box allowed menu navigation to work for me. Also I think some of the input settings are a little different between the XBox gamepad and the Android TV gamepad. So check this page out: http://docs.nvidia.com/gameworks/index.html#technologies/mobile/game_controller_spec.htm and make sure your input manager is set up correctly. Hope this help, good luck!

Edit: It appears that enabling 'Allow Activation On Mobile' screws up touch input. Trying to find a solution now.

Edit 2: Alright! So it looks like the thing to do is to leave the 'Allow Activation On Mobile' unchecked/disabled and then in the Start function of a script check for gamepad presence. If a game pad is present, then enable 'Allow Activation On Mobile'. You can check for a gamepad with Input.GetJoystickNames(). To access the event system, you'll need to include using UnityEngine.EventSystems. In my game I have a game manager that keeps a record if a gamepad is present so here's my script:

 using UnityEngine;
 using System.Collections;
 using UnityEngine.EventSystems;
 
 public class DetectGamepad : MonoBehaviour
 {
     void Start()
     {
         if (Input.GetJoystickNames().Length > 0)
         {
             GetComponent<StandaloneInputModule>().allowActivationOnMobileDevice = true;
             GameObject.FindGameObjectWithTag("Game Manager").GetComponent<ManagerUsingGamepad>().SetUsingGamepad(true);
         }
     }
 }

Also, I'm assuming your game is aiming to receive both touch and gamepad input. So when you enable your menu, you'll need to set one of the menu buttons to 'Selected'. Otherwise menu navigation won't work since there's not start point to navigate from. Here's another simple script I added to the start button of my main menu:

 using UnityEngine;
 using UnityEngine.UI;
 
 public class GamepadMainMenu : MonoBehaviour
 {
     public Button startGamebtn;
 
     void Start()
     {
         if (GameObject.FindGameObjectWithTag("Game Manager").GetComponent<ManagerUsingGamepad>().GetUsingGamepad())
         {
             startGamebtn.Select();
         }
     }
 }

Hope this helps! Good luck and happy programming :)

Comment
Add comment · 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

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

25 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Is it allowed to use Admob on Android TV and Apple TV? On internet there are many confusing answers 0 Answers

(Sony) Android tv remotes 0 Answers

Unity Ads controller support 0 Answers

publishing app for android tv 0 Answers

cursor.visible(false) not working on android TV 1 Answer


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