How do I detect where touches are (Mobile)

In the game I am making, I want the player to move left when I touch the left side of the screen and move right when I touch the right side of the screen. I have tried using buttons, but On Click() only detects when it is touched and not how long its touched. I watched the documentation and I only found out how to detect a touch, but not where it touches.

With touches you work this way. Firstly you get the amount of touches via touchCount then you loop through all touches and using GetTouch get their respective position, then check the position of Touch and compare it to Screen.Width.

If you’ll want to project coordinates from screen to world and back and forth then use ScreenToWorldPoint and WorldToScreenPoint, there are more of those as well, that’s just to introduce you to touch world.