Swipe control weird on android device - android

So I am making a simple Basketball Shoot game, that use the swipe gesture (swipe down to up to throw balls).
When I use Unity remote 4 on my android device, everything works fine, when I swipe my finger, it throws a ball according to the swipe movement.
But when I build my app, and run it on my android device, the swipe gesture works, but it throw balls in other direction that doesn't match the swipe direction.
I run my app on two different devices, and they have different directions for the same swipe movement.
How can I fix that? do I need to setup something in unity player settings?
Thanks a lot :)

I am assuming that you are using RayCast to detect swipe gesture. If that so then update your question with code snippet. We have to play bit smartly while using RayCast.

Related

OVR Gaze Pointer Ring jitters when Application runs on Android device

I am using Oculus VR toolkit to build a Unity3D Application for Gear VR. I followed the given tutorial to setup my UI. But Gaze Pointer Ring provided with in the toolkit jitters when I try to move head a bit faster.
I also tried to add a small cube as child of OVRCameraRig at certain distance in z axis to make it visible and it has same behaviour. At first I thought that jitters in Gaze Pointer Ring is due to nun-optimised code but child of camera Object which is supposed to move smooth along with parents movement has the same problem.
Has anyone faced the same problem earlier?

CardBoard: In 360 video, how can I use both gesture and device movement together?

I have been stuck on this issue for a week.
Currently, I'm able to control it with gesture using Matrix4.setLookAt() function. I'm able to control it by moving around the device.
However, I tried to combined both gesture and device movement together. When I swipe up/down, the gesture will start to move the screen at an angle (down and left, up and right). Here is the video demonstration:
youtube link
I'm new to camera matrix. Can anyone give me advice on this?
Thanks

How to add multiple pages in AIR for Android

I want to add multiple pages in my Android App, similar to the home screen on my phone, I want to be able to swipe left and right to see multiple pages.
I'm developing my app in Adobe Flash CC 2014 using "AIR 16.0 for Android".
Anyone know how I can do this?
You can go with different approaches for this problem. You could create some SwipeGestures to detect that or you could go the way Flash went since 1999, setup a Movieclip (or many) and listen for onMouseDown (ontouchstart) events and then say mc.startDrag(); (you want to limit the drag-movement to the X axis). Then onMouseUp (ontouchend) you can determine if the current MC is relativly cented and then tween it into the middle of the screen, or if the page is to far left/right and therefore page to the next page. There is also a Touch Drag implementation out of the box with ontouchmove .
Basicly what you are looking for is some kind of coverflow for AS3 ... or something a lot less fancy. Please make yourself comfortable with startDrag and StopDrag and you will see how you get there my doing.

Android Gestures to Replace Physical Arrow Keys

I'm starting from scratch and I don't even know where to look.. or even what to call this.. so any help would be appreciated.
I am working with the Snake example that Google supplies and I want it to work on Android devices without physical keys. How would I be able to use touch gestures (up/left/right/down) to make the snake turn and whatnot.
Again, I don't even know where to start looking.. I'm still slowly learning my way through programming for Android.
Thanks!
You could implement View.OnTouchListener. I think this page is the one you're looking for.
I would modify it so that touching the top part of the screen sent the snake up, the left side sent it left, etc.

What is gesture in Android

I would like to know what is meant by gestures in typical mobiles more specifically android ones. Android supports gesture recognition.
Is a gesture termed as when user
holds the device and shakes it(say
upwards, downwards or side- side)?
Is a gesture termed as when a
finger is placed on the screen and
traced UP,DOWN,RIGHT,LEFT? If so
what is the difference between touch
screen and gestures.
I am confused between 1) and 2) option.
What is a gesture exactly?
As I understand it, a gesture is anytime a user touches the screen and does a pre-defined motion that the system understands. I would venture to say that shaking the phone is not a gesture, but a function of detecting changes in the accelerometers.
From Android's reference web page, a gesture is a hand-drawn shape on a touch screen. It can have one or multiple strokes. Each stroke is a sequence of timed points. A user-defined gesture can be recognized by a GestureLibrary.
https://developer.android.com/reference/android/gesture/Gesture.html
I see gestures as being a type of input pattern that you expect from the user. I.e., you can setup mouse gestures in web browsers to do things like going "Forward" or "Back" in the browse by doing a specific "gesture" (maybe middle mouse button click and moving the mouse left goes "Back").
I'll give a brief answer to your bonus question: Yes, it's quite possible to to character recognition from input gestures on Android. In fact, at least one major vendor has already ported an existing handwriting engine to that platform. Works beautifully, but there's a lot of legal and marketing cruft to take care of as well before it ends up on real devices :(

Categories

Resources