How to move Player Object horizontally with Touch while moving Forward Constantly?

Out on the app store there are games that involve keeping your finger on the screen at all times, and moving slightly left or right of the player to move it in that direction. Basically, where ever you put your finger on the screen, the Player should move to the position of your x coordinate touch input whilst you’re touching, and holding on the screen.

Basically, hold your finger on the screen and move left and right, whilst its still on it to move.

Any advice? Need it to really be in one script, on the Player GameObject.

you definitely want these in separate scripts. Controls should be separate from actions.

to get your player to move constantly, you just need to run a move function in Update or FixedUpdate