Navmesh Path Test Component
Navmesh Path Test (plAiNavMeshPathTestComponent) requests a route between two objects and draws the result. It tests pathfinding without moving a character or running behavior logic.
Test a route
- Create a floor with static physics collision and an obstacle to route around.
- Configure a navmesh type and path search type in AI project settings.
- Place two objects near the floor, one on each side of the obstacle. Add Navmesh Path Test to the start object.
- Assign the destination object to
PathEndusing an object reference. - Select
NavmeshConfigandPathSearchConfig, and enable all three visualization options. - Simulate the scene. Allow time for the requested sectors to build.
The corridor is the set of navmesh polygons used by the route. The path line is the route through that corridor. The state text describes the search status; a partial route is not proof that the destination can be reached.
Move the destination while simulating to inspect route changes. Test a destination on the same open floor first, then across a doorway, around an obstacle, and in an intentionally unreachable area.
Properties
| Property | Purpose |
|---|---|
PathEnd | Destination object reference. |
NavmeshConfig | Physical navmesh configuration. |
PathSearchConfig | Ground permissions and traversal costs. |
VisualizePathCorridor | Draw the polygons making up the route. |
VisualizePathLine | Draw the line through the corridor. |
VisualizePathState | Draw the search state at the start object. |
If nothing appears
- Confirm that the scene is simulating and
PathEndresolves to an existing object. - Check both configuration names and move both endpoints close to walkable ground.
- Set
AI.Navmesh.Visualize = 0in Panels > CVars to inspect the generated mesh. - Verify the floor's collision layer, surface ground type, slope, and agent clearance.
- If the search area is large, inspect
AI.Navmesh.ShowBuildStatsor prebuild a smaller test region.
Once this test succeeds, use the same settings on AI Navigation. If the NPC then fails to move, investigate its destination request, movement mode, or controller separately from pathfinding.