Make a box move on mobile by drag (thouching)


I have this box and falling ball. (all 2d)
I want the player to move the box and catch the ball. the box is open from the top.
So when the player drags the box it moves so he can catch the ball.
I use 2D image with Polygone2d collider (to warp the box border) and Rigibody2D.
Currently i can move the box up/down left/right using the arrow keys, but need it to work also by dragging.
I have PlayerController.cs script where i control the movment.

You mean, exactly like the first example on the Input.GetTouch() documentation page?

I managed to make it work. but it causes some colliding problems since i can’t control the movement speed with drag.

Does anyone have implantation with rigidbody2D.MovePosition?