↧
Answer by PrimeDerektive
Did you try setting a custom gui style to the label and playing with the alignment of the text? That sometimes throws me off.
View ArticleAnswer by kennypu
Ok I figured out what was going on. Apparently, the WorldToScreenPoint and WorldToViewportPoint functions return an integer(or float respectively) starting from 0,0 at the BOTTOM LEFT of the screen....
View ArticleAnswer by Lone-Coder
Here's what I'm using. It's not perfect but close enough for debugging. Any idea on how it could be fixed? void OnGUI() { var point = Camera.main.WorldToScreenPoint(transform.position); GUI.Label(new...
View ArticleAnswer by alejandro__
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 =...
View Article