Having trouble checking if the player is in a trigger.

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);
    		}
    	}
    }

try var inBox : boolean = false; //just to make sure it’s set to off.

also try Input.GetMouseButtonDown(0); instead.

I think you need to capitalize onTriggerEnter to OnTriggerEnter