How can I get the current x position of touch in Android?

Hello, how can I get the current X position of the users touch in android if the screen is touched? For example when I touch the screen there will be printed the X position in the Console? (using the Unity Remote)

Is that possible?

Thanks, Andreas :slight_smile:

You’re joking right? The example at Unity - Scripting API: Input.GetTouch shows how you can access the touch events. And see Unity - Scripting API: Touch.position for the coordinates of the touch on the screen.

@Graham-Dunnett, I resent your sarcasm. Read those examples yourself, and tell me where they say how the screen coordinates are to be interpreted at all the possible orientations of the device’s screen, relative to Andreas’ Unity game? Do they change when the device orientation changes, or does Andreas have to compensate-- e.g., Input.GetTouch.position.y becomes -.x in landscape left orientation? Those examples don’t address that issue. So, when you scoff at his question, your presumption that you know what he is thinking is really, really inappropriate. You gave him good links, but you’ve no reason to ridicule his perfectly reasonable question because you have not a clue why he is asking it. The documentation is incomplete and imperfect; therefore, your presumption that he hasn’t read them or comprehended them is almost certainly wrong.