Quantcast
Channel: Questions in topic: "ios"
Viewing all articles
Browse latest Browse all 4709

Differentiating between a tap from a swipe on Android

$
0
0
I'm trying to differentiate a tap from a swipe. I have it in my game so if you tap the screen, the character on the screen jumps, and if you swipe down, he slides/ducks. The problem is, I can't seem to figure out how to differentiate a tap from a swipe. The character will always jump, because the jump code is simply: `if (Input.touchCount > 0) { Jump(); }` I've seen some people ask the same question, and some people answer "check time.deltaTime and see if it has moved or stayed still", this seems like a good way to do it, but I'm not sure *how* to do it.

Viewing all articles
Browse latest Browse all 4709

Trending Articles