- Home /
How is "Touch.tapCount" bounded?
I'm having a little trouble understanding the values I am getting out of Touch.tapCount...
How is this function "bounded" the script reference is kinda vague. Lets say I want to detect a "doubt tap" on an object in my environment to trigger a function. So Inside update I have something like this.
if (Input.touchCount == 1) {
Touch touch = Input.GetTouch(0);
if (touch.tapCount == 2 &&
rayAtTouch(touch.position) &&
hit.collider.gameObject.layer == (int)Layers.Index.interactionLayer)
{
Debug.Log("GOING OFF!");
}
}
The value coming out of touch.tapCount seems all over the place. When is it resetting that value? I get it's representing touches but in exactly what frame of reference? Is there a better way to be check for taps manually?
Answer by Fattie · Oct 23, 2012 at 06:09 AM
there is a massive explanation here
http://answers.unity3d.com/questions/326253/strange-touch-behavior.html#answer-326285
follow the example step-by-step tutorial for full explanation
Cool thanks a lot man! I actually noticed that tap count appears to be bounded by the ScreenSpace point the tap occurred at. The script reference should most likely indicate this. It's not bounded by any measure of time at all. It just resets the varible when the users taps on a different part of the screen.
Your answer
Follow this Question
Related Questions
Unity double tap explanation -1 Answers
Make an object move in the direction of touch 0 Answers
Having an issue with getting my touch controls working 0 Answers
Touch joystick tutorials ? 0 Answers
android touch input 1 Answer