Moving NPC to Edge of the destination

Hi, as the title said. How do i stop NPC Moving if it already at edge of the destination?

Since im using PathfindingService, the Waypoints goes like this: [Those red parts are waypoints]

But how do i make the waypoints goes like this:

1 Like

Perhaps one idea could be to cover those areas with large parts called like “Water” or something, then when you move the player to a new point and you’re waiting for them to arrive, you can raycast from the player’s torso with the direction being their facing direction. If the ray hits Water, break the loop that’s moving the player to the different way points.

Another option, although I don’t know much about this, but you may be able to modify the NavMesh that PathfindingService uses, this would require research though

1 Like

Thanks! I completely forgot about Raycast, now it works what i want.

1 Like