How do I stop the player and npc’s from walking off a platform’s ledge?
The player or npc should stop at the edge of a platform if there is no platform in front of them.
(Future plans: If they’re trying to get to the other side but can’t, they are supposed to wait for 5 seconds and then get the player’s attention to build a bridge. Then the camera will center on the character who is stuck. There is no jumping or climbing ledges in the game)
Right now, the player is colliding with the object I set as the platform, but as soon as they walk off the platform they stop and won’t go any further or back. I did not give them gravity as I do not want them falling off.