Quaternion.Slerp rotating only 90 degrees.

I am trying to make a game object face my mouse, rotating only on the y axis. However my object only rotates 90 degrees, then when my mouse goes past 90 degrees, the object just rotates in reverse 90 degrees. It’s hard to explain, so here is my code.

	//Rotate
	Vector3 mouseWorldPosition = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, 0, Input.mousePosition.z));

	Vector3 dir = transform.position - mouseWorldPosition;
	dir.y = 0;
	Quaternion rot = Quaternion.LookRotation (dir);
	rot *= Quaternion.Euler (0, 180, 0);
	transform.rotation = Quaternion.Slerp (transform.rotation, rot, rotationSpeed * Time.deltaTime);

Sorry if it’s formatted incorrectly.

@slushieboy99 I’m having a somewhat similar problem, except in my case I’m rotating an object toward a destination angle and then back again to the original rotation; but if the destination angle is roughly equal or greater than 90 degrees, it fails to rotate back again.

@slushieboy99 Same thing for me. Any solution by now?