Skip to content
BENIBIX Learn

Pathfinding

Development🎮 Game DevelopmentGame AI

Also known as Path Finding, A* Search, A-Star, A* Pathfinding, Navigation Mesh, NavMesh

How a game character finds a way round walls to a goal.

Think of it like

Think of it like a map app for game characters. It finds the way round walls to where they want to go.

Example

In Lucy's game, a dog runs to the player. Pathfinding takes it round the fence, not straight into it.

Why it matters

Characters that get stuck on walls look broken. Good paths make a world feel real.

Definition

Pathfinding is how a game character finds a way from one spot to another without walking into walls. The game sees the level as a grid or a web of points. A search, often one called A star, tries routes and keeps the shortest. The character then follows that path step by step. Big 3D games often use a navigation mesh, a map of where characters can walk.
The right panel: the guard's path goes round the dark wall to the player.

Common mistake

Working out a new path every frame for every character. That is slow, so reuse paths for a while.

Key takeaways

  1. 1
    A map of spots. The level becomes a grid or a web of points.
  2. 2
    Search for the best. A star tries routes and keeps the shortest.
  3. 3
    Follow the steps. The character walks the path in order.