Setting character to flow mouse position

I’ve looked around but can only find solutions to setting the rotation of a character to face the cursors location. I’m trying to get my “character” to be the mouse. It’s on a 2d plane and basically the character needs to be wherever the mouse is. Any pointers?

If the camera has rotation (0,0,0), you can do it this way:

var dist = transform.position.z - Camera.main.transform.position.z;
var pos = Input.mousePosition;
pos.z = dist;
transform.position = Camera.main.ScreenToWorldPoint(pos);

If the camera is an an angle, then you can use Plane.Raycast() to solve the problem.