-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pinch and Swipe together issues #58
Comments
IMO you'll want to address this concern at a "higher level". I tend to wrap all my subscribed gestures and other touch processing code into a single class that can have some concept of "game specific control state". Then I can make a determination of what to do central there based on the state the games controls are in (for example don't run swipe based movement code while zooming the camera with a pinch). This lets you isolate gesture recognition from game specific functionality. The recognizers do not have knowledge of one another and that's actually a good thing for the flexibility it allows |
I have the same problem, I couldn't find a proper solution. In my case, I control my GameObject's rotation, scale with gestures. I also have UI elements on swipe. When I pinch to scale my GO, It tends to open the UI element frequently. I tried to control this by setting the maximumNumberOfTouches = 1 in the Swipegesture script, but it doesn't recognize swipe events after a certain time. I don't really know a way to control the gesture events by setting some kind of state in my case. |
Raised a PR for this issue. We can add a maximum distance variable when checking for swipe. (Also set triggerWhenCriteriaMet = false) This solved my problem and works flawlessly. |
I have added a swipe recognizer to my character, to move him around the screen.
I also added a pinch recognizer to zoom the camera in and out.
The problem I am running into is that occasionally, while zooming the camera, the character will recognize a swipe and start walking around. Any idea how to get the swipe recognizer to see that a pinch is in progress, and ignore any swipes it thinks it is detecting?
Any help is appreciated.
-Larry
The text was updated successfully, but these errors were encountered: