how do I stop my player from moving

how do I stop my player from moving

Touch touch = Input.GetTouch(0);
                Vector3 touchPosition = Camera.main.ScreenToWorldPoint(touch.position);
                touchPosition.z = 0f;
                transform.position = touchPosition;
                transform.position = new

The above is clearly not compiling code, since it has a stray keyword “new” at the end.

If you are moving your character by an amount, when you want the character to stop moving, simply stop moving them by that amount. You can test to see if the touch exists by querying Input.touchCount.