Route
intermediate conceptsCompass Navigator Pro 4 · Core Concepts
The Route system guides the player to a destination by drawing an animated path on the mini-map, optionally a holographic line in the 3D world, plus a directional cue on the compass bar. You provide the waypoints — from script, the inspector or Unity’s NavMesh — and Compass Navigator Pro renders and animates the rest.
Setting the route
A route is a list of world space points. You can set it in three ways:
- From script — call
SetRoute()with your own points, or use the direct-line helpers. - From the inspector — enable Use Waypoints and author the list (a scene Anchor or a Position, plus an optional icon). Enabling it while a route is already active captures that route into the list.
- From NavMesh — add the optional
CompassProNavMeshRoutecomponent and assign a target; it computes the path with Unity’s NavMesh and feeds it to the route.
CompassPro compass = CompassPro.instance;
// A multi-waypoint route
compass.SetRoute(new List<Vector3> { p0, p1, p2, p3 });
// Or a direct guided line (the start tracks the player)
compass.SetRouteToDestination(targetPosition);
compass.SetRouteToPOI(targetPOI);
// Clear it
compass.ClearRoute();
Route Settings
The inspector groups the route options into three blocks: Common (apply to every surface), Mini-Map and In-World.
Common
| Parameter | Description |
|---|---|
| Show Route | Master switch for the whole route overlay (mini-map polyline, in-world line and compass bar cue). |
| Use Waypoints | Drive the route from the authored Waypoints list below instead of the scripting API. |
| Waypoints | Authored points: an optional scene Anchor (tracked if it moves) or a Position, plus an optional per-waypoint Icon. |
| Cue On Compass Bar | Shows a directional cue on the compass bar pointing to the next route waypoint. |
| Cue On Mini-Map | Shows the next-waypoint cue as a marker on the mini-map (the managed route POI). |
| Cue Sprite / Cue Title | Icon and optional title of the cue POI (e.g. “Destination”). Empty title = none. |
| Color | Route line color (start color when gradient is enabled). Shared by the mini-map and the in-world line. |
| Use Gradient / Destination Color | Blends the line color from the start color to the destination color along the route. |
| Color Travelled Part | Colors the section already covered with a different Color, optionally Solid (no pattern). Width sets the travelled thickness on the mini-map only (the in-world ribbon keeps a uniform width). Auto Progress computes the boundary automatically. |
| Smoothing | Shape of the line on both surfaces: Straight, Rounded (fillet, with Corner Radius) or Curved (a spline through every point, with Curve Detail). |
| Auto Advance | Consumes waypoints as the follow target reaches them. Reach Distance is the trigger radius; Clear On Complete clears the route at the end; Hide Travelled Markers hides the markers of waypoints already passed. |
| Max Segments | Maximum number of route segments tessellated on the mini-map per frame. |
Mini-Map
| Parameter | Description |
|---|---|
| Polyline On Mini-Map | Draws the route polyline on the mini-map. |
| Width / Width Space | Line thickness, in screen Pixels (constant on screen) or World meters (foreshortens under perspective and tilt). |
| Texture | Optional texture tiled along the line (replaces the plain line; its alpha is the shape, tinted by Color). With Tiling, Tiling Space and Flow Speed for the animated scroll. |
| Edge Softness | Antialiasing softness of the line edges. |
| Show Waypoint Markers | Shows an icon marker at every waypoint on the mini-map (per-waypoint icon or a default circle). Marker Size is in pixels. |
In-World
| Parameter | Description |
|---|---|
| Show Path In World | Draws the route as a holographic line in the 3D world, projected on the ground. Uses the shared Color, Gradient and Travelled settings. |
| Width | World-space width (meters) of the in-world line. |
| Always Visible | Draws on top of everything (ignores depth). Off = the line is occluded by world geometry. |
| Min / Max Distance | Fades the line out when closer than Min, or beyond Max, from the follow target (meters). 0 = no limit. |
| Texture | Optional texture tiled along the in-world line, with Tile Length (meters per repetition) and Flow Speed. Without a texture, Edge Softness controls the antialiasing. |
| Show Waypoint Markers | Places the waypoint icons as camera-facing billboards in the 3D world. Marker Size is in world meters. |
| Ground Projection | How the line and markers are placed vertically: Fixed Height (constant world Y, no raycast) or Raycast (drapes onto the ground using a layer Mask, lifted by Offset and sampled every Sample Step meters). |
In-world route
Turn on Show Path In World to draw the route as a holographic ribbon in the scene, draped over the ground and seen through the main camera. It shares the Color, Gradient and Travelled-part settings with the mini-map line, so both stay consistent. Use Always Visible to keep it on top of geometry, and the Min/Max distance fades to stop it cluttering the view near the player or reaching the horizon.
Ground Projection controls how it sits vertically: Fixed Height draws it at a constant world Y (cheapest, good for flat scenes), while Raycast drapes it onto whatever the ground Mask hits, lifted by Offset and sampled every Sample Step meters so it follows terrain.
Enable Show Waypoint Markers under In-World to place the waypoint icons as camera-facing billboards in the world. They use the same per-waypoint icons as the mini-map markers and follow the same ground projection.
The travelled part
Enable Color Travelled Part to highlight the section the player has already covered, on both the mini-map and the in-world line. Progress is computed by projecting the followed object onto the line, so the boundary moves smoothly within a segment rather than jumping from waypoint to waypoint. With Solid on, the covered part is drawn as a solid line while the rest keeps its style. To drive progress yourself, turn Auto Progress off and set compass.routeProgress (a value from 0 to 1).
The compass bar cue
The directional cue is a managed point of interest placed at the next waypoint, so it inherits the full POI presentation: title, distance text, vertical position and icon options. It is tagged with isRouteWaypoint = true and exposed as compass.routeWaypointPOI so you can tell it apart from your own POIs. The global Show POIs mini-map toggle does not affect it.
Scripting
void SetRoute(IList<Vector3> worldPoints)Sets the active route from a list of world space points.
void SetRouteToDestination(Vector3 worldPos)Direct guided line from the followed object to a world position.
void SetRouteToPOI(CompassProPOI poi)Direct guided line to a POI; the start and end track the player and the POI.
void ClearRoute()Removes the active route.
float routeProgressTravelled fraction (0..1). Auto-computed unless Auto Progress is off.
CompassProPOI routeWaypointPOIThe managed POI used as the next-waypoint cue.
Events
UnityEvent OnRouteUpdatedFired when the route is set or changed.
UnityEvent<int, Vector3> OnRouteWaypointReachedFired when a waypoint is reached (its index and world position).
UnityEvent OnRouteCompletedFired when the last waypoint is reached.
UnityEvent OnRouteClearedFired when the route is cleared.
NavMesh helper
Add the optional CompassProNavMeshRoute component, assign a Target transform or POI and bake a NavMesh in your scene. It recomputes the path when the player or target moves and feeds it to the route automatically, keeping the compass decoupled from your pathfinding.
Suggest an improvement
Help us improve this documentation page.