Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

How Can I return the rotation value I entered into the inspector?

$
0
0
So I had made a cube and rotated it's z to 40. But when I typed this:


void OnGUI()
{
GUI.Label(new Rect(10,0,150,150), (Mathf.Rad2Deg*transform.rotation.z).ToString());
}

Then the number on the screen that appeared was not 40, it was like 19.278138 or something.

What's with that? How do I get it to give me the value that I inputted in the inspector?

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>