Find path to an actor
Connect your quest, interaction, or marker system to Find Path to Actor on BP_WaypointComponent. This tutorial mirrors the shipped ThirdPersonCharacter pattern with a minimal standalone example.
When the player accepts a quest or selects an objective, draw a nav path to that actor.
Data flow
Section titled “Data flow”flowchart TD Quest[Quest / interaction system] --> SetTarget[Store target Actor reference] SetTarget --> Call[Find Path to Actor on BP_WaypointComponent] Call --> Internal[Internal_StartPathFinding] Internal --> Spawn[Spawn or spline visuals]
Example — key press to current objective
Section titled “Example — key press to current objective”This matches the demo project’s F key binding.
1. Add the component
Section titled “1. Add the component”On your player character:
- Add BP_WaypointComponent (see Getting started).
- Add a Spline Component on the same actor if you plan to use SplineMesh mode later (optional for Spawn mode).
2. Store the target actor
Section titled “2. Store the target actor”Add an Actor variable on your character, for example Current Objective:
| Variable | Type | Default |
|---|---|---|
| Current Objective | Actor (or BP_ObjectiveActor) | None |
Set it from your quest Blueprint when the player accepts a task:
sequenceDiagram participant Quest as BP_QuestGiver participant PC as Your character participant WC as BP_WaypointComponent Quest->>PC: Set Current Objective = self PC->>WC: Find Path to Actor (Current Objective, Spline)
3. Call Find Path to Actor
Section titled “3. Call Find Path to Actor”Create a function Update Objective Path (or copy from ThirdPersonCharacter → Find Path to Actor):
| Step | Blueprint node |
|---|---|
| Validate target | Is Valid on Current Objective |
| Fallback (optional) | Get All Actors of Class → BP_ObjectiveActor → index 0 |
| Pathfind | BP_WaypointComponent → Find Path to Actor |
| Inputs | Actor = objective, Spline Component = pawn spline (can be None in Spawn mode) |
Minimal graph (Spawn mode, no HUD):
[Input Action or Custom Event] → Is Valid (Current Objective) → Find Path to Actor (Current Objective, None)4. Handle moving targets
Section titled “4. Handle moving targets”If the objective actor moves (patrol NPC, moving platform):
| Setting | Value | Effect |
|---|---|---|
| Tick Time | 0.25 – 1.0 | Re-queries path automatically |
| Mesh Distance | 250 – 350 | Wider spacing reduces spawn cost |
Leave Tick Time at 0 if the target is static and you only path once.
Example — interact to set objective
Section titled “Example — interact to set objective”Alternative pattern without a global quest variable:
- BP_ObjectiveActor (or your interactable) fires On Interacted.
- Cast to player → get BP_WaypointComponent.
- Call Find Path to Actor with self as the actor input.
sequenceDiagram participant Obj as BP_ObjectiveActor participant PC as Player character participant WC as BP_WaypointComponent Obj->>PC: On overlap / interact PC->>WC: Find Path to Actor (Obj, Spline)
Place BP_ObjectiveActor in the level for a visible billboard marker (T_Objective texture on Material Billboard).
Example preset — escort quest
Section titled “Example preset — escort quest”| Setting | Value | Reason |
|---|---|---|
| Tick Time | 0.5 | Escort NPC moves |
| Max Number Of Meshes | 40 | Limit spawn count on long paths |
| Mesh Distance | 300 | Slightly sparser trail |
| Nav Filter Class | Your custom filter | Optional — restrict to walkable areas only |
Apply on BP_WaypointComponent class defaults on the player pawn.
Clear or disable the path
Section titled “Clear or disable the path”| Action | How |
|---|---|
| Toggle off | Set Enable Waypoint (false) |
| New target | Call Find Path to Actor again with the new actor |
| Location switch | Find Path to Location clears actor mode internally |
Reference implementation
Section titled “Reference implementation”Study the full demo wiring (HUD toggle, fallback actor search):
- ThirdPersonCharacter → Find Path to Actor
- ThirdPersonCharacter → EventGraph — F key binding
You do not need to migrate ThirdPersonCharacter — only BP_WaypointComponent and its dependencies.