Skip to content

Commit b0f0510

Browse files
authored
Update pathfinding.md
1 parent d04c878 commit b0f0510

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

content/en-us/characters/pathfinding.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ Pathfinding calculations consider only parts within certain vertical boundaries:
3737

3838
The direct line-of-sight distance for pathfinding from the start to the finish point must not exceed 3,000 studs. Exceeding this distance will result in a `Enum.PathStatus|NoPath` status.
3939

40+
### MoveToFinished limitation
41+
42+
Whilst using the `Class.Humanoid.MoveToFinished|MoveToFinished` event to detect when the character reaches each waypoint will work in most use cases, in larger games or games with numerous NPCs find less optimal perfomances and stuttering due to a delay in this event.
43+
44+
By default, each player's `Class.PlayerScripts` contains a `Class.ModuleScript` named **PlayerModule**. Within `PlayerModule`, you will find another `Class.ModuleScript` called **ClickToMoveController**.
45+
46+
To determine when to move to the next obstacle, you should use the `IsCurrentWaypointReached` function provided by the **ClickToMoveController** module under `Class.PlayerScripts`.
47+
48+
An example of using this method can be found under the [Pathfinding Tutorial Experience](https://www.roblox.com/games/138975162426147/Pathfinding-Tutorial-Experience), or as a [model](https://create.roblox.com/store/asset/95888831676289/Player-Path-Following-Script).
49+
50+
4051
## Create paths
4152

4253
Pathfinding is initiated through `Class.PathfindingService` and its `Class.PathfindingService:CreatePath()|CreatePath()` function.

0 commit comments

Comments
 (0)