How should i do note that will be show at only once…
I think i need collider, with boolean true or false.
False note not readed ( collider have’t activated ).
True, player visited collider and have got note…
also i think i need something show texture or text…
You can use GUITexts to show a text on the screen when you enter a trigger. If you prefer a texture you’ll have to code under function OnGUI. Heres an example of both.
GUI Text
var hint : GUIText;
var InTrigger : boolean = false;
function OnTriggerEnter(other : Collider){
if(other.gameObject.name == "Hint1"){
InTrigger = true;
}
}
function OnTriggerExit(other : Collider){
if(other.gameObject.name == "Hint1"){
InTrigger = false;
}
}
function Update(){
if(InTrigger){
hint.text = ("Press Space to jump") + ("");
}
else
hint.text = ("") + ("");
}
Texture
var hint : Texture;
var InTrigger : boolean = false;
function OnTriggerEnter(other : Collider){
if(other.gameObject.name == "Hint1"){
InTrigger = true;
}
}
function OnTriggerExit(other : Collider){
if(other.gameObject.name == "Hint1"){
InTrigger = false;
}
}
function OnGUI(){
if(InTrigger){
GUI.Box (Rect (Screen.width - 100,0,100,50), hint);
}
}
Just attach one of the scripts to your player and see what happens. It’ll only work if you name the trigger Hint1.