+ 1
How can I make a script to Touch on mobile screen?
Can anyone tell me how to make a script in unity to touch on mobile screen?
1 Answer
+ 2
Check out the example provided in Unity's API on Input.getTouch
https://docs.unity3d.com/ScriptReference/Input.GetTouch.html
There is a Touch struct that handles device screen touches.
Input.touchCount -> Returns the number of 'touches' on the screen (finger or stylus).
Then, Input.getTouch, gives us that Touch struct.
The Touch struct has attributes like the position, angle, action (is it moving?) Etc.. on the screen.
Touch struct:
https://docs.unity3d.com/ScriptReference/Touch.html