navmeshes & area (water) avoidance?

I have a few types of ais in my game. I want to keep certain ais only in the water while I make others avoid it (unless they get pushed into it in which case they should try to get to the closest shore)

Is this possible with the nav mesh and perception system?

I’d also want to make sure that the fish-like ais would only stay below the water and never go on shore but I have not figured out a way for that.

I can post screenshots of my setup if that helps, I’m just wondering roughly whats required to get this working.

One idea I have is having lots of different hidden collision boxes that trigger different behavior (for example, once a land based ai hits an invisible box covering the water, it’ll trigger a behavior tree where the ai runs home or something) but it just sounds a bit messy. I was hoping/expecting there to be cleaner methods to do this than lots of collision boxes.

1 Like