I need a way to display as a GUI text the Y-value for rotation of the main camera with the mouse.
I apologize for lack of coding knowledge, but this is a very simple way to do it, I just can't get it to work:
var target : Transform;
function Update () {
var angle : float = Quaternion.Angle(transform.rotation, target.rotation);
}
function OnGUI () {
GUI.Label (Rect (10, 10, 100000, 200000), target.rotation.ToString());
}
The problem I'm having is that I can display the vector values for the quaternion, and they change as my mouse rotates (0, 1, 0, 0) for 0 degrees, (0, -1, 0, 0) for 180. But how do I just display "0", or "180"?