Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 /
  • Help Room /
avatar image
1
Question by AhmedTheTall · Apr 27, 2016 at 09:18 PM · androiduibuttontouchbutton trigger events

UI button events not working on android

After testing UI buttons int the editor and making sure they're working fine, I went ahead and deployed an APK package to my Android phone. While the buttons show the clicking animation, the functionality is simply not there. I did multiple tests and tried different solutions posted online and nothing worked for me. Here is a snapshot of my EventSystem. I tried enabling the "Force Module Active" for both Standalone and Touch input modules in all the different combinations but not avail. alt text

And here is a snapshot of one of my Button GameObjects. I tried disabling the "Graphics Raycaster" script on the parent GameObject containing the Canvas component. I tried changing the way the function that is called through the EventTrigger attached to buttons works. The function that is called through the EventTrigger calls a function on another object if that helps. (Note: ButtonEventHandler is my script and not to be confused with Unity's Standard Assets' "ButtonHandler" script. It contains two methods that I have written with the names OnPointerDown and OnPointerUp) alt text

It is as if the functions are not being called when the buttons get tapped on the phone. They work perfectly when clicked with a mouse in the Unity Editor.

eventsystem-snapshot.png (36.3 kB)
button-components-snapshot.png (86.8 kB)
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 hellaeon · Jul 04, 2016 at 11:01 PM 0
Share

Hi there, did you manage to work this out? I have switched to android build and my mac sometimes gets events, sometimes doesn't...I cannot figure it out if its a bug or not.

avatar image andry57 · Dec 28, 2016 at 08:17 PM 0
Share

It happened to me one time and I think it's a bug

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by hellaeon · Jul 04, 2016 at 11:04 PM

Ignore my comment, I just realised you need to attach a standalone input module to the canvas

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 pedrampk · Jul 13, 2018 at 02:19 PM

in a project, my UI buttons worked in Editor but not worked in Android device. my problem was solved after searching on "problems with IsPointerOverGameObject()" function. the bellow page helped me to solve this problem. I hope it is usefull for you.

https://answers.unity.com/questions/1115464/ispointerovergameobject-not-working-with-touch-inp.html

it seems that you should use IsPointerOverUIObject() user defined function.

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 ajitrko7 · Nov 27, 2020 at 01:59 AM

Hello, I am working on a android project..thirdperson game..I use fixed joystick for movement and Ui buttons for other functions..everything is work fine in editor..but after build for mobile..joystick works fine..but when I press ui button..the screen gets entirely dark..I tried many ways...help me to sort out this.Thanks in advance.

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.

Follow this Question

Answers Answers and Comments

107 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

Related Questions

How to disable button text UI 0 Answers

Touch on 2D gameobject: should i use a GUI button? 1 Answer

How do I transfer the control to the PC on your android? how to change the script the character animation that would work? what should be done? 1 Answer

How do I change a state in an FSM with an UI button? 0 Answers

Unity 3D UI Button Not Working When Touched (Mobile)? 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