- Home /
Swipe Detection Best Practices
Hi everyone !
I am currently doing the inputs for my game. I need to detect horizontal and vertical swipes for the main character movements (Left / right / jump / duck). I currently detect it using a percentage of the screen width or height. The only issue with that is the results can vary regarding the devices. I guess the best practice will be to detect the swipe using real physical size. That way it should not be device dependent. Is it safe then to use the Screen.dpi property ?
And ideas / thought ?
Thanks a lot, Cheers!
Answer by outasync · Oct 03, 2015 at 02:08 PM
Personally I would buy a ready made solution from the asset store. I have bought many assets for my project and it has saved me so much coding time.
There may even be free assets that do what you need, you could look at the code and see how its done and then create your own version.
Your answer
Follow this Question
Related Questions
Touch Controls 0 Answers
Swipe gestures: responsiveness vs. stability 0 Answers
How to display Swipe Marks on iPhone 1 Answer
Diagonal swipe issues on Android 1 Answer
inputfield and scroll rect, how to switch with one touch? 0 Answers