- Home /
GUI Not Showing when interacting
I've got a script setup to interact with objects/NPCs and have found the interaction to be working, but when trying to make a simple GUI to show when interacting with the object, it will not show. Here is the code I'm using. From what I've looked up, this appears to be the correct way to show GUIs.
public class bandido2 : Actor {
public bool showGUI = false;
void onInteract()
{
showGUI = true;
Debug.Log ("Trying to show GUI");
}
void OnGui() {
if ( showGUI == true )
GUI.Box (new Rect(10, 10,300, 400), "Greetings, it is nice to meet you!");
}
}
The interacting is working properly and going to the console, however the GUI doesn't even so much as flash across the screen.
What am I doing wrong here?
Comment
Your answer
Follow this Question
Related Questions
3d model shown in GUI Window 1 Answer
Fill a circle by values with onGUI 0 Answers
How to display a set of guiText OnGUI 0 Answers
OnGUI() Resources 1 Answer