Changing the target on SpringFollowCamera

I have looked all over these forums and found similar post about what I am trying to do. I didn’t find anything that I could get to work so I was wondering if it is possible to change the target on the below script to be the mouse cursor position.

var target : Transform;
var damping = 6.0;
var smooth = true;

@script AddComponentMenu("Camera-Control/Smooth Look At")

function LateUpdate () {
	if (target) {
		if (smooth)
		{
			// Look at and dampen the rotation
			var rotation = Quaternion.LookRotation(target.position - transform.position);
			transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * damping);
		}
		else
		{
			// Just lookat
		    transform.LookAt(target);
			
		}
	}
}

function Start () {
	// Make the rigid body not change rotation
   	if (rigidbody)
		rigidbody.freezeRotation = true;
}

Not sure what it would do, but…

transform.LookAt(Input.mousePosition);

That didn’t work but I know that is going in the right direction.

Input.mousePosition is in screen pixels, and you need a 3D world position. There are some threads mentioning how you can use Camera.ScreenToWorldPoint to do the conversion, or alternatively use a raycast to intersect with an appropriate point.