I’ve got it so that if 2 booleans are true, a print command is run. Here…
var isVolcanoTxtShowing : boolean = false;
var showAgain : boolean = true;
function OnTriggerEnter () {
isVolcanoTxtShowing = true;
}
function OnTriggerExit () {
isVolcanoTxtShowing = false;
}
function OnGUI () {
if(isVolcanoTxtShowing && showAgain){
print("hi there");
showAgain = false;
}
}
What have I done wrong now… >:/
The problem here is that you are only printing that once, and only in the first GUI step! Something which would be more useful to you, I think, instead of printing to a log file, would be the GUILayout.
function OnGUI () {
if(isVolcanoTxtShowing && showAgain)
{
showAgain = !GUILayout.Button("Press me to make the message go away");
}
}
Basically, you’ve done nothing wrong, exactly, but what you have done isn’t very useful to you.