# This file is automatically generated. Please don't edit it manually. # To submit a bug report on the content, see # https://devforum.roblox.com/c/bug-reports/documentation-issues/72 name: PathfindingService type: class memory_category: Instances summary: | Used to find logical paths between two points. description: | **PathfindingService** is used to find logical paths between two points, ensuring that characters can move between the points without running into walls or other obstacles. By default, the shortest path is calculated, but you can implement pathfinding modifiers to compute smarter paths across various materials, around defined regions, or through obstacles. See [Character Pathfinding](../../../characters/pathfinding.md) for usage details. code_samples: [] inherits: - Instance descendants: [] tags: - NotCreatable - Service - NotReplicated deprecation_message: '' properties: - name: PathfindingService.EmptyCutoff summary: | Sets the percent of a voxel has to be occupied to be considered empty. Defaults to 0.16. description: | This function worked with the legacy pathfinding system. The pathfinding system currently uses a navigation grid and the EmptyCutoff is unused. When the `Class.PathfindingService` computes a path using `Class.PathfindingService:ComputeRawPathAsync()` or `Class.PathfindingService:ComputeRawPathAsync()` it uses the voxel representation of the world. A voxel is one cube in a grid overlaid on the world. In this case the voxels being used are 4x4x4. This property sets the percent of a voxel has to be occupied to be considered empty. Defaults to 0.16. code_samples: [] type: float tags: - NotReplicated - Deprecated deprecation_message: | This property is deprecated, since the legacy pathfinding system using it has since been removed. Do not use it for new work. security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: true can_save: false capabilities: - Basic methods: - name: PathfindingService:ComputeRawPathAsync summary: | Computes and returns a `Class.Path` between two `Datatype.Vector3|Vector3s`. If the given MaxDistance is greater than 512, an error will be thrown. (MaxDistance is too large). description: | This function computes and returns a `Class.Path` between two `Datatype.Vector3|Vector3s`. If the given MaxDistance is greater than 512, an error will be thrown. (MaxDistance is too large). code_samples: [] parameters: - name: start type: Vector3 default: summary: '' - name: finish type: Vector3 default: summary: '' - name: maxDistance type: float default: summary: '' returns: - type: Path summary: | A `Class.Path` object. tags: - Yields - Deprecated deprecation_message: | This item has been superseded by `Class.PathfindingService:FindPathAsync()` which should be used in all new work instead. security: None thread_safety: Unsafe capabilities: - Basic - name: PathfindingService:ComputeSmoothPathAsync summary: | Computes and returns a smooth `Class.Path` between two `Datatype.Vector3|Vector3s`. description: | This function computes and returns a smooth `Class.Path` between two `Datatype.Vector3|Vector3s`. This function fulfills the same purpose as `Class.PathfindingService:ComputeRawPathAsync()`, but creates a much smoother path for an NPC to follow in comparison. code_samples: [] parameters: - name: start type: Vector3 default: summary: '' - name: finish type: Vector3 default: summary: '' - name: maxDistance type: float default: summary: '' returns: - type: Path summary: '' tags: - Yields - Deprecated deprecation_message: | This item has been superseded by `Class.PathfindingService:FindPathAsync()` which should be used in all new work instead. security: None thread_safety: Unsafe capabilities: - Basic - name: PathfindingService:CreatePath summary: '' description: | Creates a `Class.Path` object based on various agent parameters. Valid keys and values in the `agentParameters` table are as follows:
| Key | Type | Default | Description |
|---|---|---|---|
| AgentRadius | integer | 2 | Determines the minimum amount of horizontal space required for empty space to be considered traversable. |
| AgentHeight | integer | 5 | Determines the minimum amount of vertical space required for empty space to be considered traversable. |
| AgentCanJump | boolean | true | Determines whether jumping during pathfinding is allowed. |
| AgentCanClimb | boolean | false | Determines whether climbing Class.TrussPart|TrussParts
during pathfinding is allowed. |
| WaypointSpacing | number | 4 | Determines the spacing between intermediate waypoints in path. |
| Costs | table | {} | Table of materials or defined
Class.PathfindingModifier|PathfindingModifiers and their
"cost" for traversal. Useful for making the agent prefer
certain materials/regions over others. See here for details. |