So I divided the screen into 2 spaces. Whichever side is pressed, the player will move in that direction. The problem I have is that when there is a finger on one side, and another side is touched, then the player will move to that side. I do not want this.
float h = 0f;
if (Input.touchCount > 0)
{
Touch firstTouch = Input.GetTouch(0);
if (firstTouch.position.x > HalfOfScreenWidth)
h = 1f;
else
h = -1f;
}