Have you seen this QA post? One of the people there gives example code that moves a cube around, so maybe it will work for you?
If you are wanting to move the square so that it's position is underneath your finger, then this code should work:
(I am assuming your project is 2D. Also, I have not tested this code, so it may not work)
func _input(event):
if (event is InputEventScreenTouch):
get_node("square").global_position = event.position;
elif (event is InputEventScreenDrag):
get_node("square").global_position = event.position;
Hopefully this helps :smile: