This class is a Service! It is a top-level singleton which can be retrieved using the
This item is not replicated across Roblox’s server/client boundary.
This object cannot be created with the Instance.new constructor function.
PathfindingService is used to find paths between two points. These paths make sure that characters can move between the points without running into walls or other obstacles. Paths can be used for both player-controlled characters and non-player characters.
This service has one function,
PathfindingService/CreatePath|CreatePath(), which creates a
Path object based on various parameters.
Articles/Pathfinding|Pathfinding guide for details and examples on using pathfinding in Roblox.
PathfindingService generates a “navigation mesh” over all parts in a place while the game is running. Any path that is created with the service will stay within the mesh. If the geometry of the place changes — for example, if a part is created or a part moves — the navigation mesh will be recalculated.
To see the navigation mesh for a place:
- Open the place in Studio.
- Navigate to File → Settings….
- In the Studio tab, under Visualization, toggle on the Show Navigation Mesh setting. The mesh will then show up in the 3D view.
The purple areas show where a character can walk, while the non-colored areas are considered blocked. Studio also displays arrows on top of the mesh which show where a character would have to jump to reach one part of the mesh from another.
re-compute a path on the same object if any dynamic changes within the place block the path.">[Deprecated]
Path between the two provided points