FIRST of all im sorry for all the things i’ve said recently i was just getting a little worked up because java is very frustrating since i have just got into it . thank you for the help i’m getting , any help will be appreciated.
SO my question is , how come this says ou can only call GUI functions from inside OnGUI?
var Switch : GameObject;
Switch = gameObject.FindWithTag("switch");
function OnTriggerEnter (other : Collider) {
if(other.tag == "Player"){
OnGUI ();
}
}
function OnGUI (){
if(GUI.Button(Rect(100,100,100,100),"Click to play")){
Switch.animation.Play("Bridge");
}
}
And also the Gui button appears even when im not inside the trigger . Feel free to edit my question if it will help me.