Fps Free Look script whilst moving in the same direction

Hi I’m looking to try and adapt the Fps camera script so when character is moving in any given direction the player is able to press and hold “say ALT” and then the camera will detach from being able direct the players movement and then being able to look around the game world with a restricted degree of rotation. Then snapping back to the direction the player is moving when the key is not being pressed anymore.

Is there a script already out there that can do this is this possible with the engine or could i get some pointers on how to achieve this.

if(GetKey(KeyCode.LeftAlt) == 0){

         Input.GetAxis("Mouse X")  use for rotating player, 

        Input.GetAxis("Mouse Y") use for rotating the camera up and down locally using Quaternion.

        camera.tansform.LookAt(PlayerObject.transform.forward + Vector3(0,1,0) ) // return camera's rotation to 
       //forward direction; the camera has to be sitting above the transform of the player. We add a vector to 
       //the target of lookAt just to raise the camera's direction higher
}

else{
   (GetKey(KeyCode.LeftAlt)){

             //Input.GetAxis("Mouse X") to rotate the camera around the Y axis LOCALY, using Quaternions
             //Input.GetAxis("Mouse Y") to rotate the camera around the X axis LOCALY AS WELL, using quaternions
}