- Home /
Question by
NutellaDaddy · Mar 30, 2014 at 03:37 AM ·
guimouse position
How to position GUI right beside mouse at all times?
I want my gui to be positioned by my gui all th time when it is showing. Input.mousePosition isn't working so do you guys have any other idea on how to do this?
Comment
Best Answer
Answer by Lo0NuhtiK · Mar 30, 2014 at 04:03 AM
void OnGUI()
{
Vector2 mousePos = Event.current.mousePosition ;
GUI.Box(new Rect(mousePos.x, mousePos.y, 150f, 50f), "BoxAtMousePos") ;
}
Your answer
Follow this Question
Related Questions
Draw crosshair INSTEAD of cursor. 1 Answer
GUI not work after building 1 Answer
Mobile controls, gui mouse problem. 0 Answers
Center GUI Window to screen Middle? 2 Answers
GUI Text rendering problem in WebGL 3 Answers