This is the code, what I’m trying to accomplish is set “inBox” to true when the player is inside a trigger, and if inBox is true, let the player left-click to ‘Level up’. When I step inside the box, nothing changes. The box is an empty game object with a box collider component on it, “is trigger” is checked.
var level : int;
var inBox : boolean;
function onTriggerEnter(other : Collider) {
if(other.tag == "Player"){
inBox = true;
}
}
function Update(){
if(inBox){
if(Input.GetButtonDown("Fire1")){
level=(level+1);
}
}
}