iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
To move an NPC, give it navigation data for the space it can traverse, ask the navigation system for a route to a reachable destination, and make the character follow that route. Patrols, chasing, and roaming build on this foundation. The exact division of responsibility differs by engine: some systems move the agent for you, while others return a next waypoint that your character controller must apply.
How NPC navigation and movement fit together
NPC movement is usually a sequence of related but distinct jobs:
- Navigation data describes where an NPC can go. For many ground-based characters, this is a navigation mesh: a representation of walkable space.
- Pathfinding selects a route through that space from the NPC to its destination.
- Movement advances the character along the route using the engine’s agent or character controller.
- Animation makes the character’s pose and movement appear consistent with its actual motion.
These jobs may be connected by a built-in component, but they are not interchangeable. A destination request cannot create a route where navigation data says no traversable route exists, and a calculated route does not necessarily move or animate a character automatically.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteNavigation meshes work well for many characters walking through mostly ground-based levels. They are not a universal solution for grid movement, swimming, flying, or unrestricted three-dimensional movement. Those cases may need a different representation of the world and movement logic suited to the game’s mechanics.
#1 Best Overall
What to prepare before requesting a destination
- Usable navigation data: Generate or provide navigation for the surfaces the NPC should traverse. Check that the relevant level area is included.
- A fitting agent: Set the agent’s dimensions and traversable areas to match the character. An agent that is too wide may be unable to use a passage that looks wide enough for the model; one with incorrect area settings may take or reject routes unexpectedly.
- A reachable target: Choose a destination on, or connected to, the navigable area. If the target is outside reachable space, the system may not find the route you expect.
- Movement integration: Decide whether the engine’s navigation agent controls movement or whether your character controller consumes path positions and moves the character.
For a moving character, also decide how navigation motion, collision handling, and animation relate to one another. The navigation component’s result must ultimately be reflected in the character’s position and presentation.
How to make an NPC move to a destination
The general workflow is to prepare navigation, issue a target, and confirm that the NPC actually follows the resulting route. Here are the documented patterns in three common engines; they are not interchangeable APIs.
Unreal Engine
Unreal Engine’s Navigation System builds a navigation mesh from level collision geometry. It represents that mesh as tiles and polygons, with polygon costs contributing to route selection. A basic workflow is to provide navigable level space, then use an AI Move To request to send the pawn to a destination. Epic’s Navigation System documentation for Unreal Engine 5.8 explains the system; the Basic Navigation guide for Unreal Engine 5.8 demonstrates a Navigation Mesh Bounds Volume and destination requests.
Rank #2
- Book 2
- Pages: 32
- Level: Elementary
- Instrumentation: Piano/Keyboard
Unity
Unity’s NavMesh Agent component combines pathfinding with movement control for a character navigating a NavMesh. Assign a destination through the agent, then configure its speed, size, area mask, automatic repathing, and off-mesh-link traversal as needed. See Unity’s AI Navigation 1.1.5 NavMesh Agent component reference and the Unity 6.0 NavMeshAgent API reference. Unity’s AI Navigation package also supports NavMeshes, dynamic obstacles, and links for actions such as jumping. Check that the package documentation matches the editor version in your project.
Godot
In Godot, NavigationAgent3D calculates a path and provides the next path position; the parent character remains responsible for moving. Setting target_position alone does not move the character. The parent should call get_next_path_position() each physics frame and use the returned position when deciding its next movement. Godot’s NavigationAgent3D API reference describes this interface. That URL documents the current master branch, so check the API for your project’s Godot version before using it.
How to build a patrol or roaming behavior
A patrol is a sequence of destination requests, not a separate kind of pathfinding. Choose patrol points that are reachable in the navigation data, send the NPC to the next point, and advance the sequence when it arrives. For roaming, select another reachable destination after arrival rather than following a fixed sequence.
Rank #3
- 320 PAGES, MORE THAN 250 FULLY-DETAILED NPCS - Full statistics and tactics for characters of every level of every class in the Core Rulebook, ready for instant use.
- SPEEDS PREP TIME WHEN IT MATTERS MOST - Drop a fully-built NPC into a session on short notice instead of statting one out from scratch between sessions.
- THE FAMOUS ICONIC CHARACTERS INCLUDED - Pathfinder's own iconic characters appear at various levels of development, ready to use as allies, rivals or replacement PCs.
- TACTICS, NOT JUST STAT BLOCKS - Each NPC comes with tactical notes for how to actually run them in combat, not just numbers on a page.
- PLEASE NOTE, FIRST EDITION COMPANION VOLUME - A companion to the Pathfinder RPG Core Rulebook, not a standalone game or a Second Edition product.
Epic’s Unreal Engine 5.8 Basic Navigation example demonstrates a pawn choosing a random reachable location nearby and using AI Move To. It repeats the choice after arrival or failure. This is a useful demonstration pattern, not a guarantee that unrestricted random choices will produce purposeful behavior in every game. For designed routes, use authored waypoints; for more reactive behavior, select the next destination according to the NPC’s state and the game’s rules.
Recommended Free Tools
How to handle obstacles, crowds, and special traversal
Static obstacles and moving obstacles are different problems
Pathfinding plans a route through the world’s navigation representation. Local avoidance responds to moving obstacles or nearby agents while the NPC moves. An NPC can have a valid route and still need avoidance to prevent collisions with another character crossing its path. Conversely, avoidance does not replace long-range pathfinding around walls or other obstacles represented in the navigation data.
Unreal documents RVO and Detour Crowd Manager as options for avoiding dynamic obstacles and other agents. See Epic’s Using Avoidance With the Navigation System in Unreal Engine. Godot’s NavigationAgent3D documentation also describes avoidance for static and dynamic obstacles when navigation data is available. The behavior and setup are engine-specific, so choose the matching system rather than assuming a setting in one engine has an equivalent effect in another.
Rank #4
Connect spaces that are not continuously walkable
If two navigable areas are separated by a gap or require an action such as a jump, a continuous walkable surface may not be enough. Unreal navigation links can connect areas without continuous walkable space and support actions such as jumping. Unity AI Navigation supports links for actions such as jumping. The NPC’s behavior still needs to perform the appropriate traversal action when it reaches the connection.
Update navigation data deliberately
For levels that change during play, determine whether navigation should be baked in advance, updated dynamically, or modified in a more limited way. Unreal documents static, dynamic, and dynamic-modifiers-only generation modes. Navigation Modifier Volumes can alter traversal costs or make areas unavailable. Epic cautions that constant runtime mesh generation has high computational cost in its runtime-modification example; that is a qualitative warning, not a quantified performance result. Measure the cost in your own scene and update only the parts and at the times your game requires. See Epic’s overview of modifying the Navigation Mesh in Unreal Engine 5.8.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
How to choose a movement approach
Start with the shape of the game world and the behavior the NPC needs. A ground-based character in a level of walkable surfaces is a natural fit for mesh-based navigation; grid movement or free flight may call for a different approach.
Best Value
- Pocket edition paperback: Compact 6.5 x 8.5 inch format for easy portability; 320 pages; must-have companion to Pathfinder RPG Core Rulebook and Bestiary
- More than 300 character stat blocks: At least one for every level of every class in Core Rulebook; from lowly forest poacher to majestic knight or ancient spellcaster
- Tactical suggestions included: Ensures you get most out of each character's gear and abilities in fight; perfect for planning encounters or improvising at table
- Flavorful names and backgrounds: Give characters personality with ideas for combat and roleplaying situations; NPC classes for ordinary people and prestige classes
- Comprehensive GM tools: Animal companion statistics levels 1-20 for druids and rangers; multiple iconic character versions; encounter groups for quick battles
| Question | Why it matters |
|---|---|
| Is movement ground-based, grid-based, or free 3D? | The world representation and movement logic must fit the space. A navigation mesh is intended for traversable surfaces, not every movement model. |
| Does the level change during play? | Static navigation may suit stable geometry; changing geometry may require runtime updates, which should be profiled. |
| Does the NPC patrol, chase, follow, or roam? | The behavior determines how destinations are selected and when new requests are issued. |
| Are obstacles static or moving? | Route planning handles the navigable world; local avoidance addresses moving obstacles and nearby agents. |
| Must the NPC use doors, jumps, stairs, or drops? | Some transitions need navigation links or equivalent connections plus character behavior to perform the action. |
| Who owns movement and animation? | Some agents control motion; in other setups the character controller must apply path positions and coordinate animation. |
| How many agents and updates will run? | Crowd behavior and runtime navigation updates can affect CPU cost. Profile the actual target scene rather than relying on assumptions. |
Why an NPC may not move as expected
- The NPC does not move at all: Confirm that navigation data covers its starting area and target, and that a route can connect them. Then verify that the destination request is actually issued and that the movement layer consumes the navigation result.
- The NPC stops before the target: Check whether the destination is outside reachable space or separated by an area the agent cannot traverse. Inspect agent dimensions and area settings against the level geometry.
- The character seems to have a path but remains still: Check the engine’s movement model. In Godot, the parent must call
get_next_path_position()every physics frame and use the result to move; setting a target alone is not enough. - The NPC walks into a moving character: A route around static level geometry is not the same as local avoidance. Configure and test the engine’s avoidance behavior for dynamic obstacles and crowds.
- The NPC cannot cross a gap or perform a jump: Check for a navigation link or equivalent connection and ensure the character behavior performs the required action.
- Changes to the world cause excessive work: Avoid regenerating navigation constantly without need. Profile the scene and choose an update mode and frequency appropriate to the geometry changes.
When debugging, inspect the navigation representation and the agent’s dimensions alongside the character’s actual movement. A correct route calculation can still produce the wrong visible result if controller integration, collision, or animation does not match it.
Validate the result in your project
Test a destination in a small representative section of the level before building more behavior on top of it. Then test narrow passages, unreachable targets, moving obstacles, crowds, and special traversal separately. Profile runtime navigation updates and avoidance in the scene and on the platform you intend to support. Finally, verify API names and package compatibility against the documentation version matching your engine; the cited references include Unreal Engine 5.8, Unity 6.0 and AI Navigation 1.1.5, and Godot’s current master API.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →

