Project DifficultiesThe fish (and human) ai use a waypoint system to move around and if the player is spotted, they flee in the opposite direction. But what happens when they reach the edge of the map? They can't go any further.
My SolutionI didn't have a lot of time to be debugging ai pathfinding on this project, so I came up with a creative workaround. I placed the waypoints so that they aren't close to the edges of the map. Once the fish see the player, flees and reaches the boundary, they despawn. As the draw distance is low, this all happens out of view and once the player has moved on, the fish respawn at their original location. It's simple but works well.