Reset slerp to.rotation to avoid follow through

Good day to you fellow humans,

Im a little puzzled by the following and wish to seek the assistance of someone cleverer than myself. I would like to reset a to.rotation after slerping to the current transform.rotation to avoid continuing the previous slerp the next time the code is called.

This is the relevant part, works fine:

		if (Input.GetMouseButton (0)) {
			rotationX += Input.GetAxis ("Mouse X") * cameraSensitivity * Time.deltaTime;
			rotationY += Input.GetAxis ("Mouse Y") * cameraSensitivity * Time.deltaTime;
			rotationY = Mathf.Clamp (rotationY, -90, 90);

			Rotat = Quaternion.AngleAxis (rotationX, Vector3.up);
			Rotat *= Quaternion.AngleAxis (rotationY, Vector3.left);

			transform.rotation = Quaternion.Slerp (transform.rotation, Rotat, Time.deltaTime * LookDamping);

Now i would have thought that adding this…

		if (Input.GetMouseButtonUp (0)) {
			 Rotat = transform.rotation;

…would stop the camera rolling on to the previous target rotation the next time the button is clicked, but it doesnt seem to do anything.

Any thoughts?

Following code was the answer, got there in the end, though not sure i totally understand the logic of it.

		if (Input.GetMouseButtonUp (0)) {
			rotationX = transform.eulerAngles.y;
			rotationY = (0 - transform.eulerAngles.x);

As you can see RotationX/Y are flipped from eulerangles.x/y, not sure why it should be like that but it works so hey. Thanks whydoidoit for prodding in the right direction.