- Home /
Count Number of Touches made in Android
How to determine how many times user touched the screen in Android with one finger I can't use touchcount & tapcount property as it only works with ios
Answer by Amon · Feb 20, 2018 at 09:08 AM
Have a 'static int numberOfTouches = 0;' and whenever the user taps the screen += 1 the numberOfTouches.
Setup a timer to capture the number of touches within a certain period of time and if no touch happens after say 5 seconds, reset numberOfTouches to 0.
Answer by Xpartano · Feb 28, 2018 at 03:44 PM
If by "Count number of touches" you mean count how many times do a user touch the screen, Input.GetMouseButtonDown should do the trick, and work in any platform (not sure if it works in PS4 and Xbox)
https://docs.unity3d.com/ScriptReference/Input.GetMouseButtonDown.html