Look at Mouse?

I am making a top down, twin stick style shooter for pc. I basically am trying to get my player to rotate to look at my mouse cursor. I have read through about a billion forum posts where people are asking the same thing, with many more people replying with “solutions” and then the original poster says they don’t work/help for any reason and then the forum post ends with no conclusion.

I tried using/modifying the mouse look script that comes with unity and only using the Mouse X axis, but that only makes the player turn when moving side to side with the mouse (for obvious reasons).

There has to be someone who has created a simple script or knows how to make an object face the mouse position. Any help is greatly appreciated. I’ve been trying for days to get this to work.

Here are two solutions. Both assume the camera is higher (greater ‘Y’ value) than the character.

function Update () {
	var v3Pos = Vector3(Input.mousePosition.x, Input.mousePosition.y, Camera.main.transform.position.y - transform.position.y);
	transform.LookAt(Camera.main.ScreenToWorldPoint(v3Pos));
}

And the second solution:

function Update () {
	var plane : Plane = new Plane(Vector3.up, transform.position);
	var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
	var dist : float;
	plane.Raycast(ray, dist);
	transform.LookAt(ray.GetPoint(dist));
}