I am a noob at this stuff, only been doing a little while and i found a script that will display text one the Tag=“Player” enters into the box collider, now it worked great.
It displays it in the center and lets me close it, but the only issue is that every time i walked into it it would pop up and i had to click close, over and over.
So i tried to add a delete function, it did delete it but the problem is it deletes it before it even loads the text to read.
`
var player : GameObject;
private var bool : boolean;
function OnTriggerEnter(other : Collider) {
if(other.tag == "Player") {
bool = true;
Destroy(gameObject);
}
}
function OnGUI(){
if(bool == true) {
if(GUI.Button (Rect (500, 300, 500, 80), "You can move by pressing the W,A,S,D Keys
Press Space Bar to Jump, (E) Key is Action!
[Click to close]")) {
bool = false;
}
}
}
`
So it keeps deleting it before i can ever display it, or i move it and nothing happens anyone know what i am doing wrong thanks.
Edit: I was told a button is not a good way but i don’t know anyone other way to achieve this, i wanted to make it check to see if a box was already open but did not work maybe you experts can offer an alternative?