OnTriggerEnter help

Ok so i need some help here, i’m trying to simulate underwater effects, so i placed the water layer with the mesh collider and isTrigger set to true, now the thing is i’m using this script:

void OnTriggerEnter (Collider myTrigger)
    	{
    
   		Debug.Log("Trigger!!");
    		if (myTrigger.gameObject.name	== "Player")
    		{			
    			/*Debug.Log("Player.y+1 "+myTrigger.transform.position.y+1);
    			Debug.Log("_location "+_location);
    			Debug.Log("Water y "+_water.transform.position.y);*/
    			
    			if (_location == "Outside") {
    				if (myTrigger.transform.position.y + 1	> _water.transform.position.y) {
    					this._location = "Inside";
    					Debug.Log("ENTERING WATER!");
    					fog = true;  RenderSettings.fog = fog;
    					RenderSettings.fogColor = fogColor;  
    					RenderSettings.fogDensity = fogDensity;  
    					RenderSettings.skybox = skybox;  
    				}
    			}else {
    				if (myTrigger.transform.position.y + 1	< _water.transform.position.y) {
    					this._location = "Outside";
    					Debug.Log("OUT OF THE WATER!");
    					fog = false;  
    					RenderSettings.fog = fog;
    				}
    			}
    		}	
    	}

Ok so here is what happens, i enter the water and therefore activate the trigger, everything works fine, then when i exit the water also the script works fine… THEN and after this point the trigger doesn´t work at all its like the trigger is activated just once… any help on this?

This mesh collider is one-sided: it only detects the player when entering in the up->down direction - no events are generated when moving in the down->up direction.

A better approach is to create a cube, adjust its dimensions to cover all the volume below the water plane and set it to trigger. You can set a inWater boolean variable in OnTriggerEnter, and clear it in OnTriggerExit. When inWater is true, compare Camera.main.transform.position.y to the water plane transform.position.y: if it’s lower, turn the underwater effect on, otherwise turn it off (player script):

bool inWater = false;
Transform water; // drag the water plane here

void OnTriggerEnter(Collider other){
  if (other.CompareTag("WaterVolume")){ // tag the trigger box as WaterVolume
    inWater = true;
  }
}

void OnTriggerExit(Collider other){
  if (other.CompareTag("WaterVolume")){
    inWater = false;
  }
}

void Update(){
  if (inWater && Camera.main.transform.position.y < water.position.y){
    // set the underwater effect on
  } else {
    // set the underwater effect off
  }
}