Hello,
i have my top down game map and it has some water in it, i want the player to switch to swimming mode when hes on water, for now there is just the map which is generated with tiles of dirt and water, and the player which has nothing connected to the map, how do i do it? plz help, in c# if possible.
you can make a saprate image to water & add a box collider to it & make it is trigger & tag it & box collider to player then in player script :
void OnTriggerEnter2D(Collider2D other) {
if(other.tag == "water")
// swwim
}
but if you don’t want that you have to cheek the player position if it inside the water position which is not recommended specially if you have a lot of water in your map.