Slerp with transform.rotation Not Working...

I realize this question has been asked and I’ve seen them and followed what they said, but it’s still not working. I even watched some YouTube tutorials. I’ll post my code below.

What I’m wanting to do is to rotate and move my camera when I press a key. When I let up the key, I want to return to my initial camera. This works if I’m just using Vector3.Lerp, however I want to be able to rotate as well because it will look better. Thank you!

using UnityEngine;
using System.Collections;

public class LeanLeftRight : MonoBehaviour {

	public Transform leanLeft;
	public Transform leanRight;
	public Transform cam;
	public Transform initCam;

	void LeanLeft()
	{
		Debug.Log("LeanLeft");
		//FVAPI.lerpVectorAndQuaternionTimeMultiplied(cam, leanLeft, 5);
		cam.rotation = Quaternion.Slerp (cam.rotation, leanLeft.rotation, 1);
		/* The code above that is commented out is the same as below except I'm 
		 * 	making the Slerping automatic instead of over time, just wanted
		 *	to make that clear.
		 */
	}

	void LeanRight()
	{
		Debug.Log("LeanRight");
		//FVAPI.lerpVectorAndQuaternionTimeMultiplied(cam, leanRight, 5);
		cam.rotation = Quaternion.Slerp (cam.rotation, leanRight.rotation, 1);
		
	}

	void LeanBack()
	{
		Debug.Log("LeanBack");
		//FVAPI.lerpVectorAndQuaternionTimeMultiplied(cam, initCam, 4);
		cam.rotation = Quaternion.Slerp (cam.rotation, initCam.rotation, 1);
		
	}

	void Update()
	{

		if(InputManager.GetKey("leanLeft"))
			LeanLeft();
		else if(InputManager.GetKey("leanRight"))
			LeanRight ();
		else
			LeanBack();

	}

}

If you supply 1 to the Slerp function, it will return the “to” quaternion immediately. You won’t have any blending effects. If you supply a fraction to Slerp like 0.5f, you should see an animated response. I made a version that uses RotateTowards instead of Slerp. The net effect will look different. If you want to use Slerp, go ahead and change the method from RotateTowards to Slerp and adjust leanSpeed.

using UnityEngine;

public class LeanLeftRight : MonoBehaviour
{
    public Transform leanLeft;
    public Transform leanRight;
    public Transform cam;
    public Transform initCam;

    public float leanSpeed = 360f;

    void Lean(Transform to)
    {
        cam.rotation = Quaternion.RotateTowards(cam.rotation, to.rotation, 
                                                              leanSpeed * Time.deltaTime);
    }

    void Update()
    {
        // I don't have InputManager so I rely on keys Q and E.
        if (Input.GetKey(KeyCode.Q))
            Lean(leanLeft);
        else if (Input.GetKey(KeyCode.E))
            Lean(leanRight);
        else
            Lean(initCam);
    }
}