Quantcast
Channel: Answers for "Trying to draw GUI.Label() at object position"
Viewing all articles
Browse latest Browse all 9

Answer by alejandro__

$
0
0
So in case that anyone falls in here, here's a solution with code: private string text; void OnGUI() { var position = Camera.main.WorldToScreenPoint(gameObject.transform.position); var textSize = GUI.skin.label.CalcSize(new GUIContent(text)); GUI.Label(new Rect(position.x, Screen.height - position.y, textSize.x, textSize.y), text); }

Viewing all articles
Browse latest Browse all 9

Latest Images

Trending Articles





Latest Images