• 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 Pmehx · Oct 28, 2019 at 08:11 PM · android

Ui Buttons only work on SOME phones (android)

Hi guys, in beta testing for my game i found that the UI buttons dont work on some peoples phones. My test device the buttons work. Half of beta tester cant press the buttons without trying REALLY hard.

Comment
Add comment · Show 1
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 Bonfire-Boy · Oct 29, 2019 at 11:51 AM 0
Share

Have you managed to deter$$anonymous$$e what devices are causing problems (and whether they have anything in common eg screen resolution, dpi, OS)? That should be your first step.

I've had this kind of thing caused both by drag threshold and by element overlap so, given your response to Legend_Bacon's suggestion, I'd recommend you look into cdr9042's.

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Legend_Bacon · Oct 28, 2019 at 08:19 PM

Hello there,


There shouldn't be a difference in UI interaction between devices.


Could you make sure that it isn't another UI element that's blocking the button?


Depending on the different devices resolutions, the UI might be scaling in a way that puts invisible UI elements in front of the buttons, preventing the users from pressing it.
You could test this by either slightly tinting your UI elements to different colours and seeing how they overlap, by unchecking the "Raycast Target" on the elements that may be in front of the buttons, or by making an empty scene with JUST one button in the center, and testing the click on the previously non-working devices.


I hope that helps!

Cheers,

~LegendBacon

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 Pmehx · Oct 28, 2019 at 08:27 PM 0
Share

Nah on my pc it is tested at a LOT of odd resolutions and every known android resolution. Nothing is blocked in the unity editor due to scaling.

avatar image Pmehx · Oct 28, 2019 at 08:42 PM 0
Share

I will try isolating the problem like you said.

avatar image
0

Answer by Pmehx · Oct 28, 2019 at 08:56 PM

Ok some more info, i am using this asset: https://assetstore.unity.com/packages/tools/input-management/fingers-touch-gestures-for-unity-41076

i read i am supposed to have a touch input module on my eventsystem but i dont have them, maybe thats it.

Edit: i guess touch input module was integrated into standalone input module which is present

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

Answer by cdr9042 · Oct 29, 2019 at 07:29 AM

Is there any setting related to Reference DPI in the asset you use?

If anything, the reason can be the Drag threshold was too low, on screen with high DPI, user's tap can be misinterpreted as a swipe.

You can try this code to automatically set the drag threshold to scale with the screen DPI (which I grabbed from here http://ilkinulas.github.io/programming/unity/2016/03/18/unity_ui_drag_threshold.html)

 int defaultValue = EventSystem.current.pixelDragThreshold;        
     EventSystem.current.pixelDragThreshold = 
             Mathf.Max(
                  defaultValue , 
                  (int) (defaultValue * Screen.dpi / 160f));
Comment
Add comment · Show 1 · 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 Pmehx · Nov 03, 2019 at 07:49 AM 0
Share

Yes it does use a reference DPI. That might be it.

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

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

Related Questions

Normal map is not working with Unity 5 when Low-level Native Plugin Interface is used 0 Answers

(Android) Swiping direction 1 Answer

UnityPlayerActivity vs. UnityPlayerNativeActivity 0 Answers

Best Stereoscopic video encoding for Cardboard Android/iOS 0 Answers

Movements changing over resolutions 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