Touch input not working properly

So i’m just starting to learn touch controls in unity. I want to move an object in world space to the position on screen where i touched it. This is my code used from Brackey’s tutorial. But it only works once per play session. Any idea why?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TouchToMove : MonoBehaviour {
	
	// Update is called once per frame
	void Update ()
    { 
		if(Input.touchCount > 0)
        {
            Touch touch = Input.GetTouch(0);
            Vector3 touchPosition = Camera.main.ScreenToWorldPoint(touch.position);
            touchPosition.z = 0f;
            transform.position = touchPosition;
        }
	}
}

Could you add a Debug.Log() in the editor to ensure that the touch position isn’t the same every single frame? You might be moving it, but always to the same location.

@Bieere i added one like you said and each time the position is different for different areas of the screen touched. Also I noticed that the ScreenToWorldPoint method is causing a problem as for any touch coordinates, it’s being converted to the same Vector3.