- Home /
How do I apply a touch swipe code to be effective on all the screen?
Hello,
I am new to unity and to these forums so please excuse any wrong term. I am creating a simple 2D app that is sort of a children story book. Simple animations and simple functionality.
I was able to get a script that check the touch start and end positions etc... Meaning i have the functionality of detecting the swipe and speed and whether the user actually swiped or not.
My question is where do I add this handler script to be effective on the whole Camera (The User's screen). I need to detect when the user swipes regardless of where. I am not sure where I should be adding it. Any help is appreciated. Thanks.
Answer by jmonasterio · Aug 28, 2016 at 08:03 PM
Hard to tell what you've got already, without any code.
You might want to write a coroutine that continuously checks for swipes. Or, check for swipes in the Update() event of one of your components.
For some ideas, see: http://answers.unity3d.com/questions/35803/touch-screen-horizontal-or-vertical-swipe.html
Your answer
Follow this Question
Related Questions
player jump on mousedown and swipe 0 Answers
Unity2D iOS Dragable items by touch 0 Answers
Swipe and Joystick Together on Mobile 0 Answers
Android "mouse" speed while GetMouseButtonDown(0) 0 Answers
Make Swipe Detection Longer? 0 Answers