transition between swimming and walking

I have the animation for swimming that is activated by the bool swimming, my problem is I don’t know how to detect if the player has collided with the water’s box collider and toggle the bool, this would also need to work going back to land thank you!!

You can use onColliderEnter, and onColliderExit. When the player enter in the water collider swimming is true, and onColliderExit set the bool to false.

Sorry but my inglish is very bad.

Ok! Using “tag”. Something like this:

OnTriggerEnter(){

   if(gameObject.tag = "Player"){

        

  }

}