2

Using Unity 5.0. Working on Android.

I simply have a Canvas -> with inside a Panel -> with inside a Button.

The Button has in its Button script the OnClick() with a GameObject linked. The GameObject has a script with a function.

When I tap the button I simply trigger the function, which is working properly on Unity.

But when I deploy the project on an Android (4.4.2) device, it works only if you tap and leave the finger very fast. Otherwise if you tap and wait just a second, when you remove the finger the OnClick() is not called anymore.

Seems like it is triggering a sort of "long tap" and it is ignoring my normal tap. I am missing some seetings? I have not much code at all, just the function, the rest is all done via Unity inspector.

1
  • Please remove the "Unity" tag. If you're curious as to why, hover over the "Unity" tag. Commented Apr 1, 2015 at 16:55

1 Answer 1

3

You probably suffer from the same problem I did. Check the value for "Drag Threshold" for the "Event System (script)" which you will find in the inspector once you select the EventSystem in the hierarchy. The default value is 5 which is tiny and anything but the briefest of touches will not register as a click but as a drag. Increase the size. I use 20 and my buttons now work as expected on Android. Which reminds me I have to check this now on iOS again as well.

Good luck

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.