Answers for "Rotating about and only one axis"
http://answers.unity.com/questions/797727/rotating-about-and-only-one-axis.html
The latest answers for the question "Rotating about and only one axis"Answer by robertbu
http://answers.unity.com/answers/797775/view.html
You don't want to directly assign the x,y,z values of a Quaternion (rotation) unless you have a firm understanding of the math. You can ac$$anonymous$$eve what you want by:
Vector3 aimVector = playerPosition - transform.position;
aimVector.y = 0.0f;
Quaternion newRotation = Quaternion.LookRotation(aimVector, transform.up);
transform.rotation = Quaternion.Slerp(transform.rotation, newRotation, Time.deltaTime * rotateSpeed);Fri, 26 Sep 2014 00:35:12 GMTrobertbu