- Home /
Input for Android
I want to check if a player has touched the screen on an Android (it doesn’t matter where on the screen I just want to test any touch). I been looking at the code but I can’t figure it out.
if(Input. ? ? ?)
How do I do this? I am so lost, never done anything for Android. Please Help.
Comment
Answer by jspease · Mar 11, 2012 at 02:43 AM
If you really don't care where the touch is, you can use
if(Input.touchCount > 0)
You can call Input.GetTouch after that if you want to get more information about the touch event(s).
Answer by hirenkacha · May 18, 2012 at 06:24 AM
U can use
Input.GetTouch(i).position.x;
Input.GetTouch(i).position.y;
Input.touchCount;
if(Input.GetTouch(i).phase==TouchPhase.Began)
if(Input.GetTouch(i).phase==TouchPhase.Stationary)
if(Input.GetTouch(i).phase==TouchPhase.Moved)
if(Input.GetTouch(i).phase==TouchPhase.Ended)
Your answer
Follow this Question
Related Questions
input touch android help 0 Answers
Detect if finger lifted off screen 1 Answer
Touch Input madness 2 Answers
Touch joystick tutorials ? 0 Answers