- Home /
uGUI buttons need 2 finger touch on Android after scene change?
I have a build that has a main menu screen with a single "Start" button. Touching that button hides the Start button and brings up two other buttons, each of which calls a simple scene change. (All buttons use OnClick and the event manager.)
There are buttons in the next scenes which allow users to return to the main menu. (It's a very simple UI in general with not a lot going on.) All buttons work all the time 'as-is' when this project is built out to iOS but a very strange thing starts to happen on Android devices.
When this is built out to a Android, the main menu scene buttons work fine when the app is first launched. The buttons inside the next scenes also work fine but returning to the main menu scene causes all buttons to no longer work with OnClick events (with a one-finger touch). I just discovered quite by accident that all buttons do still work after returning to the main menu scene but only with a two finger tap now. No errors are being thrown up.
Is anyone else experiencing this anomaly? I've tried using the Standalone Input Module and the Touch Input module on the Event Manager... each by themselves as well as together, plus every possible combination of checking "Allow Activation on Standalone/Mobile" on and off but this does not fix the issue.
Other information: Unity 5.0.2f1. I am using the new Google Cardboard 2.0 SDK in my build. The only thing of note I can see in the terminal (besides a debug of mine) are these two lines:
Built-in distortion correction disabled. Causes: [Debug override]
(Filename: ./artifacts/generated/common/runtime/UnityEngineDebug.gen.cpp Line: 56)
I have a similar problem but I am not using Cardboard or VR. The first time I execute the game on android everything works but once I close the app I have to use 2 fingers to click on any buttons. I can turn phone off and reboot and it works right again.
Answer by felixwcf85 · Jun 12, 2015 at 03:05 AM
I'm facing this issue as well, building app on Android platform and also using Cardboard SDK. Hoping some Unity experts can answer this question.
[Updated]
In my case, this 2-fingers-multi-touch-detected issue only happen when you switch from cardboard scene to non-cardboard scene. My Solution is: When you want to load scene from Cardboard scene to non-Cardboard scene, before you execute LoadLevel( ), disable the VR Mode Enabled in CarboardMain game object, under Cardboard.cs script, then you execute LoadLevel( ).
ps: When you turn off VR Mode Enabled, you will experience Cardboard cameras change from VR mode to non-VR in a second, before you completely jump to the LoadLevel( ) new scene. This is ugly.
AND the solution is,
You can overcome this by disable the camera first, then only you turn off the VR Mode Enabled in CardboardMain game object, so the scenes-switching flow will be appeared smooth.
Hey felixwcf,
I've been out of town for a few days so I haven't had a chance to try this out yet. $$anonymous$$akes perfect sense though. Will mark this thread as answered when I verify your solution works on my end.
Thanks large!!!
Yes this is indeed the fix for going in and out of VR scenes within the same app on Android. Thanks again felixwcf!
$$anonymous$$y pleasure to solve your bug. Happy coding. :)
Answer by dolims · Jun 21, 2015 at 10:20 PM
This is a bug in Cardboard SDK v0.5, which will have to be fixed. To work around it you can use the method above by felixwcf. Another method is to add a Cardboard component to the non-Cardboard levels, perhaps on a dummy gameobject or on the main camera, but set the VRModeEnabled flag to false on the Cardboard component.
You sir, deserve a medallion. Thank you so much for that answer!
Answer by unity_dQfm2C-nwjY4jg · Aug 02, 2019 at 04:46 PM
Hi, I have a Unity project built with version 5.6.4f1 (from 16th of October 2017, according to https://unity3d.com/get-unity/download/archive). The unity project is exported as an Android module and used in the app accordingly.
Unfortunatelly, the same thing happens here - the buttons are accessible just with tap of two fingers. One anywhere in the Unity view and one on the actual button(s).
I understand this was a bug in 2015. But it is still present in October 2017.
Is this still a bug on the 2019 builds? Anybody from Unity can help me with an updated answer?
Thank you!
Your answer
Follow this Question
Related Questions
Instantiate not working 1 Answer
How to play unity web export in android web view 1 Answer
Saving JSON file in Android,How to save json file in android 0 Answers
UI Button OnClick Sensitivity for High DPI Devices 5 Answers
How to display yes/no confirm dialog box in unity for android games? 0 Answers