How can i convert this script into touch movement?

M

    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            startpos = Input.mousePosition.x;
        }
        else if (Input.GetMouseButtonUp(0))
        {
            if (Input.mousePosition.x - startpos > 0 && pos < 2)
            {
                pos++;
            }
            else if(Input.mousePosition.x - startpos < 0 && pos > 0)
            {
                pos--;
            }
        }
        circle.transform.position = Vector3.SmoothDamp(circle.transform.position, new Vector3(positionsset[pos], circle.transform.position.y, circle.transform.position.z), ref velocityf, 0.3f);
    }

i really need to know more about touch controlls can someone help me with it?

There are plenty of resources on this on YouTube and Google.

Indeed… you’re also welcome to sniff around my proximity_buttons package… I have the concept of a MicroTouch that maps touches and the mouse into a single interface, and there’s plenty of examples on using it within the project.

proximity_buttons is presently hosted at these locations:

https://bitbucket.org/kurtdekker/proximity_buttons

https://github.com/kurtdekker/proximity_buttons

https://gitlab.com/kurtdekker/proximity_buttons

https://sourceforge.net/projects/proximity-buttons/