# PathfindingService

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Tags: Not creatable, Not replicated, Service
- Memory category: Instances
- HTML page: https://rapi.sleaze.dev/classes/PathfindingService/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/PathfindingService

Used to find logical paths between two points.

## Properties

### EmptyCutoff

```luau
PathfindingService.EmptyCutoff: number = 0
```

- Tags: Deprecated, Not replicated, Read capabilities: Basic, Load only

**Deprecated:** This property is deprecated, since the legacy pathfinding system using it has since been removed. Do not use it for new work.

Sets the percent of a voxel has to be occupied to be considered empty. Defaults to 0.16.

## Methods

### CreatePath

```luau
PathfindingService:CreatePath(agentParameters: { [string]: any }? = nil): Path
```

- Tags: Capabilities: Basic

Creates a [`Path`](https://rapi.sleaze.dev/classes/Path.md) object based on the given agent parameters.

Parameters:

- `agentParameters`: Lua table which lets you fine-tune the path based on various agent parameters.

Returns: A [`Path`](https://rapi.sleaze.dev/classes/Path.md) object.

### FindPathAsync

```luau
PathfindingService:FindPathAsync(start: Vector3, finish: Vector3): Path
```

- Tags: Yields, Capabilities: Basic

Finds a [`Path`](https://rapi.sleaze.dev/classes/Path.md) between the two provided points.

Parameters:

- `start`: Path start coordinates.
- `finish`: Path finish coordinates.

Returns: A [`Path`](https://rapi.sleaze.dev/classes/Path.md) object.

### ComputeRawPathAsync

```luau
PathfindingService:ComputeRawPathAsync(start: Vector3, finish: Vector3, maxDistance: number): Path
```

- Tags: Deprecated, Yields, Capabilities: Basic
- Use instead: [`PathfindingService.FindPathAsync`](https://rapi.sleaze.dev/classes/PathfindingService.md)

**Deprecated:** This item has been superseded by [`PathfindingService:FindPathAsync()`](https://rapi.sleaze.dev/classes/PathfindingService.md) which should be used in all new work instead.

Computes and returns a [`Path`](https://rapi.sleaze.dev/classes/Path.md) between two `Vector3s`. If the given MaxDistance is greater than 512, an error will be thrown. (MaxDistance is too large).

Returns: A [`Path`](https://rapi.sleaze.dev/classes/Path.md) object.

### ComputeSmoothPathAsync

```luau
PathfindingService:ComputeSmoothPathAsync(start: Vector3, finish: Vector3, maxDistance: number): Path
```

- Tags: Deprecated, Yields, Capabilities: Basic
- Use instead: [`PathfindingService.FindPathAsync`](https://rapi.sleaze.dev/classes/PathfindingService.md)

**Deprecated:** This item has been superseded by [`PathfindingService:FindPathAsync()`](https://rapi.sleaze.dev/classes/PathfindingService.md) which should be used in all new work instead.

Computes and returns a smooth [`Path`](https://rapi.sleaze.dev/classes/Path.md) between two `Vector3s`.

## Inherited members

- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
