I’m trying to make a GUI.Box appear for 3 seconds, when entering a Collider (For like Zones and such).
But i seem to not be able to understand the timer.
Here’s what i’ve got so far:
var guiOn : boolean;
var guiSkin : GUISkin;
var zoneName : String;
var size : Rect = Rect(0,0,100,100);
var textTimer : float = Time.deltaTime * 2;
static var deltaTime : float;
function Start () {
}
function Update () {
if(textTimer==2){
textTimer +1;
}
}
function OnTriggerEnter(theCollider : Collider) {
guiOn=true;
}
function OnGUI () {
GUI.skin = guiSkin;
if(guiOn) {
GUI.Box(size,zoneName);
}
}
I’m still trying to make it work myself, but it would be AWESOME with some help