How can we get the camera to find the mouse position and then point the camera at the poistion

using UnityEngine;
using System.Collections;

public class MouseFollower : MonoBehaviour {

public float renderDepth = 10.0f;

void Start () {

	Screen.showCursor = false;

	if(rigidbody) {
		rigidbody.freezeRotation = true;
	}

}

void Update () {
	var mousePos = Input.mousePosition;
	var wantedPos = Camera.current.ScreenToWorldPoint(Vector3(mousePos.x, mousePos.y, renderDepth));
	transform.position = wantedPos;	

}

}

thats the current code we are using but it isnt quite working we keep getting errors and dont know why. Thank you for any and all help :smiley:

You are moving the camera to that position. To just look at that position, change the last line to:

  transform.LookAt(wantedPosition);

If you are looking to move the camera (rather than rotate the camera), let me know.