- Home /
This question was
closed Jul 14, 2012 at 12:21 AM by
TheDarkVoid for the following reason:
The question is answered, right answer was accepted
Question by
TheDarkVoid · Jun 28, 2012 at 02:18 AM ·
guitexturemousepositiontooltip
GUI Texture follow the mouse
i want to make a tooltip, which is a gui texture follow the mouse cursor. i am currently using this code to try and do this:
ToolTip.transform.position = new Vector3(Input.mousePosition.x, ToolTip.transform.position.y, ToolTip.transform.position.z);
but this doesn't follow the mouse. is there way for me to do this?
Comment
Best Answer
Answer by Berenger · Jun 28, 2012 at 02:21 AM
GUITexture are in viewport's space, not screen space. divide mousePosition by Screen.width and Screen.height. The y might be inverted, not sure.