Component
Route
Shows the way from the player to a destination as arrows on the ground, a line on minimaps and radars, and a caret on Compass Bars.
What it does
A Route shows the player the way to a destination in three places at once. On the ground it lays a line of arrows that flow toward the goal and follow terrain and stairs. On every Fog of War Minimap and Radar it draws a line in its color. On every Compass Bar it puts a caret on the strip's bottom edge that points the way to walk now along the path, such as down the corridor toward the door.
The destination can be one object, a point, the nearest of a list, a list in order, or the nearest object with a tag. In an RPG, point it at the next quest step. In a collect-a-thon, give it a list of crystals and it leads to the nearest one still standing. In a strategy or survival game, give it a tag such as Objective and it finds objectives spawned during play with no list at all.
The path follows the NavMesh when the project has Unity's AI Navigation package and a NavMesh near the player. Without one it draws a straight line, follows your Waypoints, or draws the points your own pathfinder hands it. By default the route stops where the Fog of War has never been explored, so it never gives the map away. When the player arrives it hides, plays a moment and calls an event.
Add it
- Select the destination, such as the objective, in the Hierarchy.
- Choose GameObject > Pass Forge > Route To Here.
- It leads the route already in the scene there, switches the player's own route back on, or adds a Pass Forge Route to the object tagged Player. With no player, it adds one to a new object named Route.
- A route set to Points From Script switches to Auto, since it would leave the destination unused.
- It selects the route. Edit > Undo takes it back.
- For the line on the ground, run Tools > Pass Forge > Set Up Effects once per project and turn Post Processing on for the camera. Minimaps and Compass Bars need neither.
- Press Play. Arrows run from the player toward the objective, and the status line at the top of the Inspector says what the route found, such as "NavMesh route, 42 m to go, 7 corners".

Or add Add Component > Pass Forge > Route to the player yourself and set its Target.
An objective in another scene than the route becomes a Point where it stands, since a scene keeps no link to another scene's objects. A dialog says so. From a script, SetDestination(transform) follows it.
Settings
The status line at the top says what the route found and why, such as "No path: the destination is 7.4 m from the NavMesh". The Recalculate button at the bottom finds the path again now, such as after baking a NavMesh or moving a wall. A note above it sums up the limits.
Destination
| Setting | What it does |
|---|---|
| Destination | Where the route leads. Target (default): an object, followed as it moves. Point: a place in the world. Nearest Of List: the nearest object of Targets still standing. List In Order: the Targets one after another, such as quest steps. Nearest With Tag: the nearest object with Target Tag. Grayed out with Pathing set to Points From Script. |
| Target | Shows for Target. The object to go to, such as the one with the objective's Off-screen Indicator. The route ends at its position and follows it when it moves. |
| Point | Shows for Point. A place in the world. While the route is selected, the Scene view shows a move handle labeled Route Point. |
| Targets | Shows for Nearest Of List and List In Order. The objects to lead to. One switched off, destroyed or arrived at is left behind, and the route goes on to the next. |
| Target Tag | Shows for Nearest With Tag. The tag of the objects to lead to, such as Objective. Tagged objects are looked for twice a second, so ones spawned in play are found. |
| From | Where the route starts. Leave it empty on the player. |
| Arrive Distance | Meters from the destination that count as arrived, at least 0.1. Default 2. Measured along the ground; a floor above or below does not count. |
| Hide When Arrived | Hide the route once the player gets there, until a new destination is set. On by default. Off, it shows again once the player and the destination are 1.5 times Arrive Distance apart, and arriving again plays When Arrived and calls On Arrived again. |
| When Arrived | A moment played at the destination when the player arrives, such as the Checkpoint preset. Play Mode only. |
| On Arrived | Called when the player arrives, in Play Mode only. With Hide When Arrived on it is called once per destination; off, each time the player arrives again. |
Path
| Setting | What it does |
|---|---|
| Pathing | How the path is found. Auto (default) follows the NavMesh when there is one near the player, and draws a straight line otherwise. NavMesh always follows it, and needs the AI Navigation package. Straight draws the direct line. Waypoints follows the Waypoints in order. Points From Script draws the points a script gives SetPath. |
| Agent Type | Shows for Auto and NavMesh, once the AI Navigation package is installed. Which NavMesh agent size the path is found for, such as Humanoid. |
| Areas | Shows for Auto and NavMesh, once the AI Navigation package is installed. The NavMesh areas the route may use. Default all. |
| Snap Distance | Shows for Auto and NavMesh. How far the player and the destination may be from the NavMesh and still be found on it, in meters. Default 3. |
| When No Path | Shows for Auto and NavMesh. What shows when the NavMesh has no path to the destination: Hide (default) or Straight Line. |
| Waypoints | Shows for Waypoints. The route follows these in order, from the nearest one ahead, then goes to the destination. With no destination it ends at the last waypoint. |
| Repath Seconds | How often the path is found again, from 0.1 to 5 seconds. Default 1. It is also found again at once when the destination moves 1 m or the player leaves the route. Hidden for Points From Script. |
| Ground Layers | Shows while the route draws on the ground. Without a NavMesh, the layers the line is laid onto between points, so it follows hills. Default Everything. Needs the Physics module; with it switched off, the field is grayed out and the line runs straight between points. |
Fog
| Setting | What it does |
|---|---|
| Fog Rule | Stop At Unexplored (default) stops the route where the Fog of War has never been explored, so it never gives the map away. Show Through Unexplored shows all of it. |
| Fog | Shows for Stop At Unexplored. The Fog of War the rule reads. Empty uses the one that shows. A fog that is switched off stops nothing. |
Look
| Setting | What it does |
|---|---|
| Style | Arrows (default) flowing toward the destination, a solid Line, or Dashes. Maps draw in this style too. |
| Color | Color of the route, with HDR. Alpha sets how strongly it shows. Maps and Compass Bars draw in it. Default light blue. |
| Width | Width of the line on the ground, in meters, from 0.05 to 3. Default 0.35. On screen it is never thinner than 3 pixels. |
| Glow | Soft light around the line, from 0 to 1. Default 0.5. |
| Outline | Dark edge around the line, so it reads on bright ground such as snow, from 0 to 1. Default 0.6. |
| Flow Speed | Shows for Arrows and Dashes. Meters per second the arrows or dashes move toward the destination, from 0 to 10. Default 2. Safe mode holds them still. |
| Start Gap | Meters in front of the player where the line on the ground starts, so it does not run under the character, from 0 to 10. Default 1. |
| Reach | Meters of route drawn on the ground, from 5 to 120. Default 30. The line fades out at the end. Maps are not limited by Reach. |
Show On
| Setting | What it does |
|---|---|
| Show On Ground | Show the line on the ground. It is a screen effect, so it needs Set Up Effects and Post Processing. On by default. |
| Show On Maps | Show the route on Fog of War Minimaps and Radars that have Show Route on. On by default. |
| Show On Compass | Show a caret on Compass Bars that have Show Route on, pointing the way to walk now. On by default. |
| Look Ahead | Shows while Show On Compass is on. How far along the route the compass caret points, in meters, from 1 to 30. Default 6: the way to walk now along the path. |
Notes and buttons the Inspector shows
- Set Up Effects and Turn On Post Processing warnings while the route draws on the ground.
- "The route starts at this object, which does nothing else", when the route sits on an empty object that is not the player and From is empty.
- "The route shows once it has a Target" while Target is empty.
- Install AI Navigation, when Pathing is Auto or NavMesh and the package is missing. Once it is in: Add NavMesh Surface And Bake adds a NavMesh object with a NavMesh Surface for the route's Agent Type and bakes it, or Bake NavMesh Surface bakes the one already in the scene. Both are grayed out in Play Mode, since a NavMesh baked while playing is lost when it stops. After a bake, a line says where it was saved, or that it still does not reach the player.
- In 2D: Auto draws a straight line. Use Waypoints, or hand your own pathfinder's points to SetPath. There are no bake buttons in 2D.
- At the top, a warning when the route does not show: another route was enabled later, NavMesh pathing without the package, all three Show On switches off, no path, 2D with Show On Ground, a Fog that is switched off, or the player standing where the fog was never explored.
Common jobs
Lead the player to the nearest objective with a tag
- Tag your objectives, such as Objective. Add the tag under Edit > Project Settings > Tags and Layers if the project lacks it.
- On the player's route, set Destination to Nearest With Tag and Target Tag to Objective.
- Press Play.
The route leads to the nearest tagged object. Once the player arrives, it is left behind and the route goes on to the next nearest. Objectives spawned later are found within half a second. The one led to stays until another is clearly nearer, so two at about the same distance do not take turns.
Walk a quest step by step
- Set Destination to List In Order.
- Add the quest steps to Targets in order.
- Put a moment such as Checkpoint in When Arrived.
Each arrival plays the moment and calls On Arrived, then the route moves on to the next step. A step switched off or destroyed is skipped.
Collect crystals in any order
Set Destination to Nearest Of List, add the crystals to Targets, and destroy or switch off each crystal when it is picked up. The route always leads to the nearest one left.
Follow the NavMesh around walls
- Leave Pathing at Auto.
- Press Install AI Navigation in the route's Inspector, then Add NavMesh Surface And Bake, outside Play Mode.
The status line changes from "Straight line" to "NavMesh route". A path that ends as close as it can get, such as before a locked door, still shows.
Use your own pathfinder
Set Pathing to Points From Script, or just call SetPath, which switches it for you. Hand it your grid or road graph's points whenever you find a new path. The route shows them from the player's place on them to their last point.
Keep the line off the player's character
- Add Add Component > Pass Forge > Effect Mask to the player.
- Add Add Override > Pass Forge > Gameplay > Route to your Volume and set Mask to Except Masked Objects.
Keep the line off ceilings and the floor above
In the Volume's Route override, lower Height Range (from 0.1 to 10, default 1). Surfaces farther than that above or below the line are not painted.
Show the way for a while only
Add a Show Route step to a Moment, or use the Show The Way preset, or call ShowTo. The route leads there for its seconds, or until the player arrives with zero seconds, then goes back to its own destination.
From a script
using PassForge.Effects;
using UnityEngine;
public class QuestRoute : MonoBehaviour
{
[SerializeField] Transform[] m_Steps;
PassForgeRoute m_Route;
void Start()
{
m_Route = PassForgeRoute.current; // the route that shows: the one enabled last
if (m_Route == null)
return; // null when no route is enabled
m_Route.onArrived.AddListener(OnArrived); // Play Mode only
m_Route.SetDestination(m_Steps[0]); // follows the object as it moves
}
void OnArrived() => Debug.Log("Arrived");
public void HelpAlly(Transform ally) => m_Route.ShowTo(ally, 20f); // 20 s, then back
public void CollectAll()
{
m_Route.destination = RouteDestination.NearestOfList; // nearest still standing
m_Route.targets.Clear();
m_Route.targets.AddRange(m_Steps);
m_Route.RestartList(); // arrived ones count again
}
public void Done() => m_Route.ClearDestination(); // nothing shows until a new destination
// Meters left along the route, for a label of your own; -1 with no route.
public float metersLeft => m_Route.remainingDistance;
}
using System.Collections.Generic;
using PassForge.Effects;
using UnityEngine;
public class GridRoute : MonoBehaviour
{
// Filled by your own pathfinder, such as a grid or a road graph.
readonly List<Vector3> m_Points = new List<Vector3>();
// Call whenever your pathfinder finds a new path. Up to 256 points are kept.
public void OnPathFound()
{
var route = PassForgeRoute.current;
if (route == null)
return; // no route enabled
route.SetPath(m_Points); // copies the points; switches Pathing to Points From Script
}
// What the route found as of its last update, such as Complete, NoPath or Arrived.
public RouteStatus status => PassForgeRoute.current != null ? PassForgeRoute.current.status : RouteStatus.NoDestination;
}
Good to know
- One route at a time. Only the route enabled last shows, on every minimap, radar and Compass Bar, with no filter per player. The others say "Waits" in their status line, and the Overview window names the one in use.
- One per object. An object holds one Route.
- Nothing runs without a destination, and the route allocates nothing each frame.
- 2D. In 2D, sprites leave the depth texture empty, so there is no line on the ground. Minimaps and Compass Bars still show the route. Auto draws a straight line unless you bake a NavMesh on X and Y yourself, so use Waypoints or
SetPath. - Fog. With Stop At Unexplored, the route also stops at the edge of the fog's area. With the fog's Explored Places at Close Again, only what is seen now counts. It cannot find a way around unexplored places.
- Without a NavMesh the route cannot go around walls. The Show Route step, the Show The Way moment and
ShowTofind their way as Auto does, even with Pathing at Waypoints or Points From Script. - Limits. Maps draw a route in up to 32 points, keeping every corner within 60 m of the player. The ground shows the next Reach meters in up to 32 pieces. A path keeps up to 256 points; a longer NavMesh path is cut, and the status line says so.
- On maps the chevrons and dashes hold still; only the line on the ground flows.
- The ground line is drawn after post-processing onto the surfaces in the depth texture. Water, glass, particles, and Screen Space - Camera and World Space canvases write no depth, so the line shows through them. Put a HUD that covers the ground on a Screen Space - Overlay canvas.
- NavMesh links, such as jumps and ladders, leave a gap in the line on the ground.
- A first-person camera within Height Range of the ground, such as one crouching, stands inside the box around the piece under it, which then covers the whole screen.
- Cost. An estimated 0.4 to 1.2 ms of GPU time on a mid-range phone at 1080p for the ground line. The Benchmark sample's Route, 30 m, Arrows step measures it on your device.
- Arrivals play When Arrived and call On Arrived in Play Mode only. A ShowTo place ending does not call them.
- Edit Mode. With Preview In Edit Mode on, the route follows a destination that moves and its arrows flow without pressing Play.