Skip to content

Commit

Permalink
Merge pull request Polytoria#81 from indexxing/master
Browse files Browse the repository at this point in the history
Add NPC Pathfinding Documentation
  • Loading branch information
willemsteller authored May 22, 2024
2 parents 7bf7e01 + c880721 commit 708890b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/objects/game/Environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,20 @@ for i, hit in pairs(hits) do
end
```

### RebuildNavMesh { method }

Rebuilds the navigation mesh which determines the empty space where NPCs can pathfind in.

## Properties

### AutoGenerateNavMesh:bool { property }

Determines whether or not to automatically build a navigation mesh for NPC pathfinding. This property is disabled by default so there are no performance issues with larger maps.

<div data-search-exclude markdown>
!!! note "When updating the map, even if the property is set to true, you will still have to manually call the `Environment:BuildNavMesh()` method."
</div>

### FogColor:Color { property }

The color of the fog. Fog is a visual effect that makes the world look like it is covered in a colored mist.
Expand Down Expand Up @@ -135,4 +147,4 @@ game["Environment"].PartDestroyHeight = -2000

### Skybox:SkyboxPreset { property }

The default skybox preset to use for the world, if no ImageSky is present.
The default skybox preset to use for the world, if no ImageSky is present.
22 changes: 22 additions & 0 deletions docs/objects/world/NPC.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ Clears the NPC's appearance.
npc:ClearAppearance()
```

### SetNavDestination(position;Vector3) { method }

Sets the destination for the NPC's pathfind.

## Properties

### Anchored:bool { property }
Expand Down Expand Up @@ -111,3 +115,21 @@ Specifies the color of the NPC's left leg.
### RightLegColor:Color { property }

Specifies the color of the NPC's right leg.

### NavDestinationDistance:number { property }

Returns the remaining distance before the NPC reaches the end of its pathfind.

{{ readonly() }}

### NavDestinationValid:bool { property }

Returns whether or not the NPC has a valid path to its set destination.

{{ readonly() }}

### NavDestinationReached:bool { property }

Returns whether or not the NPC has reached the end of its pathfind.

{{ readonly() }}

0 comments on commit 708890b

Please sign in to comment.