I am trying to rotate one mesh plane to turn toward another mesh plane, and it mostly works, but there seems to be a glitch when it is rotated in the 4th quadrant.
Here is the actual script I am using:
var target: Transform;
function Update(){
var wantRot: Quaternion = Quaternion.FromToRotation (transform.position, target.position);
transform.eulerAngles.z = (wantRot.eulerAngles.z-45);
}
Here is the test demo:
http://www.bunzaga.com/Unity_Tests/Demo_2d_1/WebPlayer/WebPlayer.html
If you slowly rotate the mouse around the center of the screen, you can see it almost works great, but if you rotate around the 4th quadrant, it seems like the center mesh flips for a moment, then returns back to normal.
Let me know if there is something I am doing wrong, or if there is a better option to do this, etc.
EDIT: It looks like it is when the eulerZ == 130 to 145…