- Home /
Load GUI.TextArea
I code the GUI.TextArea to follow my mouse. I would like the GUI.TextArea to disappear when I move my mouse to other location and then reappear a few seconds later. How can I do that?
Answer by YoungDeveloper · Sep 27, 2013 at 08:57 AM
Describe what is your "other location". But overally, it can be achieved by using one simple bool. And that bool can be controlled depending on your mouse location.
void OnGUI(){
if(someBool_is_true){
//gui stuff
}
}
other location meaning other position of an object. For example a plane
use raycast hit on mouse position, by hit you can access what object was hit, and from gameobject you can get its name or tag.
Your answer
![](https://koobas.hobune.stream/wayback/20220613114908im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Disable Selection on Left button Mouse Click 3 Answers
Disable component via script 1 Answer
How to get mouse position with ray from camera??? 1 Answer
GUI button disappears 0 Answers