Switch navigation modes
BP_WaypointComponent supports two ways to visualize the same nav-mesh path. This tutorial switches between them with copy-paste presets.
ENavMode overview
Section titled “ENavMode overview”flowchart TB
Query[Nav path query] --> Mode{Nav Mode}
Mode -->|Spawn| Actors[BP_WaypointActor at Mesh Distance]
Mode -->|SplineMesh| Spline[SplineMesh along SplineComp]
Actors --> Pool[Spawned Meshes array]
Spline --> BPI[BPI_Waypoint on pawn]
| Mode | Visual | Best for |
|---|---|---|
| Spawn | Discrete BP_WaypointActor arrows | Quest markers, classic “breadcrumb” trail |
| SplineMesh | Continuous mesh deformed along path | Ground-hugging line, sci-fi floor guides |
Default shipped value: Spawn.
Example A — Spawn mode (shipped default)
Section titled “Example A — Spawn mode (shipped default)”Open BP_WaypointComponent on your pawn → Class Defaults:
| Property | Value |
|---|---|
| Nav Mode | Spawn |
| Max Number Of Meshes | 60 |
| Mesh Distance | 250 |
| Draw Debug Strings | false |
Press Play and call Find Path to Actor. The component runs Internal_PathFinding_SpawnMode, spawning BP_WaypointActor instances up to Max Number Of Meshes.
Spawn tuning presets
Section titled “Spawn tuning presets”| Preset | Max Meshes | Mesh Distance | Use case |
|---|---|---|---|
| Shipped | 60 | 250 | General outdoor demo |
| Dense indoor | 25 | 120 | Corridors |
| Open world | 30 | 400 | Long paths, fewer actors |
Example B — SplineMesh mode
Section titled “Example B — SplineMesh mode”1. Switch mode
Section titled “1. Switch mode”| Property | Value |
|---|---|
| Nav Mode | SplineMesh |
2. Implement BPI_Waypoint on your pawn
Section titled “2. Implement BPI_Waypoint on your pawn”SplineMesh mode calls BPI_Waypoint on the owning actor:
| Interface function | Purpose |
|---|---|
| Add Waypoint Spline Component | Attach a new spline mesh segment |
| Remove Spline Meshes | Clear segments before rebuilding |
ThirdPersonCharacter already implements this interface — open it as a reference when adding the interface to your own pawn.
3. Pass a Spline Component
Section titled “3. Pass a Spline Component”Find Path to Actor and Find Path to Location accept a Spline Component input. The demo passes the pawn’s root Spline component.
Find Path to Actor Actor = Objective Spline Component = Spline (on pawn)Without BPI_Waypoint implemented, spline mode will not render correctly.
4. Internal behaviour
Section titled “4. Internal behaviour”When Nav Mode is SplineMesh:
- Internal_PathFinding_SplineMode samples nav path points.
- Internal_RemoveSplineMeshes clears old segments.
- New SplineMesh components are added via BPI_Waypoint → Add Waypoint Spline Component.
sequenceDiagram
participant WC as BP_WaypointComponent
participant Pawn as Pawn with BPI_Waypoint
WC->>WC: Internal_PathFinding_SplineMode
WC->>Pawn: Remove Spline Meshes
loop Each path segment
WC->>Pawn: Add Waypoint Spline Component
end
Side-by-side test on Overview
Section titled “Side-by-side test on Overview”- Open Map/Overview, press Play.
- Note the default Spawn trail when pressing F.
- Stop PIE, set Nav Mode = SplineMesh on the character’s BP_WaypointComponent.
- Play again — compare the continuous spline trail.
Revert to Spawn when finished unless your game targets spline mode.
Auto-refresh in both modes
Section titled “Auto-refresh in both modes”Tick Time works regardless of Nav Mode:
| Tick Time | Behaviour |
|---|---|
0 | Path updates only when you call Find Path again |
0.5 | Re-path twice per second (good for moving targets) |
2.0 | Light refresh for slow-moving goals |
Internal_TryStartTimer schedules the repeat using Timer Handle Find Path To Actor.
Choose a mode for your game
Section titled “Choose a mode for your game”| Choose Spawn when… | Choose SplineMesh when… |
|---|---|
| You want per-marker actors you can customize (BP_WaypointActor child) | You want a continuous ground decal / tube |
| Minimal pawn setup (no interface) | Pawn already has spline infrastructure |
| Performance-sensitive mobile (cap with Max Number Of Meshes) | Art direction needs smooth curves |