I have an NPC system, but NPCs can walk off edges, which then leads them into walking into the ocean; making them unable to get on land or swim away. (There is a ladder near a dock, but NPCs almost never use it.)
Somebody did suggest doing something with pathfinding, but I am not sure how I can incorporate it into the solution to my problem.
Heres a game with my NPC system, featuring Ariana from my game:
I want the players to still be able to walk off the edges if they want to. (There is a ladder on the dock, but almost 100% of the time, NPCs won’t go up the ladder.)