getting out of LookAt messes up first person view

I’m having problems with getting out of transform.LookAt.

Imagine having a sphere that attracts a player and also locks the player’s gaze at it until it is within a certain radius. When it is within that radius, the player can look normally again. The problem I have is that the view becomes slanted when going from right to left with the mouse as shown here.

This is the script I’m using.

using UnityEngine;
using System.Collections;

public class MoveToObject : MonoBehaviour
	public float speed = 1.0f;
	public GameObject player;
	// Use this for initialization
	void Start ()
	// Update is called once per frame
	void Update ()
Vector3 objectPosition = transform.position;
Vector3 playerPosition = player.transform.position;
		if (Vector3.Distance (objectPosition, playerPosition) > 5.0f) {
			playerPosition += speed * (objectPosition - playerPosition).normalized * Time.deltaTime;
			player.transform.position = playerPosition;
			player.transform.LookAt (objectPosition);

One thing I tried was saving the original player.transform.rotation in a variable before getting attracted by the sphere and then restoring it later. This made the player face the same direction as he did originally and that’s not what I want.

The whole player is rotated. Are you using a character controller? You should attach the camera to a child of the controller, and have the camera’s transform look at the object. If you switch to the scene view after the mouse gets screwed up, you’ll note that the collider for the player is pointed in the same direction as the camera, I’d wager.