I’m trying to get a triple tap, but it’s very unreliable.
I’m checking Input.Touches in Update(), which appears to the right place. What seems to be happening is that Update() gets invoked in between the 2nd and 3rd finger taps, so the code thinks it’s a double tap. I’d like to have triple tap mean something, but how do I get around this conflict?
Have you tried FixedUpdate? You could adjust the frequency that FixedUpdate runs to get more precision. This all assumes there’s not a hard limit to the frequency you can detect touch.
Thanks, but that sounds a little sketchy. I’d have to adjust it depending on what device it is, and scramble to update whenever Apple releases a new model… The UIGestureRecognizer class has no problem with this, I wish Unity had made sure to transfer that.
To do a good job is a lot of work - boundary function on the delta-t’s, integration with Update() and FixedUpdate(), and more. This would be two lines with a UITapGestureRecognizer, but of course that’s not available. Besides, it’d be a lot of work to implement something which is actually already in the Touch class, it just doesn’t work right.
Every single tap take 4 miliseconds, when u tap first time, u run one timer and check if user tap once again before 4 miliseconds if yes, then check once again for third tap.
Check this out may be its work for u.
Because same concept i used for tripple click and its work fine.
Well, no. The tap dwell times are not the same length, and the interval between them is not the same. To do it properly means it has to be done statistically, not literally. The mechanism is already there in UIKit.
Why not just write a simple Unity plugin, where you detect the triple tap in native and then just do a UnitySendMessage to tell Unity it happened? Could probably send the touch coordinates as a string and parse it on the Unity side.