Hi all,
I’m happy with the result of the below script- moves the camera to a hit.point.
What I’d really like to do is move my camera to the center (pivot) of an raycast hit game object.
Appreciate your suggestions.
void Update ()
{
if (Input.GetMouseButtonDown(0)){
Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);
RaycastHit hit = new RaycastHit ();
if (Physics.Raycast (Camera.main.ScreenPointToRay (Input.mousePosition), out hit, Mathf.Infinity) && hitInfo.collider)
gameObject.transform.position = hit.point;