Rotating a GUI.Label relatively

Rotating a GUI.Label relatively

Learning Unity for 2D development, I want to create a text label.
So far, I have been using GUI.Label to write the text. It is above my sprite:

I would like to rotate the label relatively to the monster. In other words:

How can I achieve this? I have a feeling that OnGUI() is probably the wrong solution.


Answer 1:

You could get the rotation of the monster and then pass it into RotateAroundPivot before drawing the text. Alternatively if it’s an option you could use the world space UI in Unity 4.6 beta to child the text to the monsters transform.