Pathfinding

2025/12/27

Type
Learning Resource
Format
Glossary Article
Version
General
Subject Tags
Code
Assets
All else
Copyright 2016-2026, GDQuest
Created
2026/02/16
Updated
2025/12/27

Pathfinding

Pathfinding algorithms are a family of algorithms that aim to find an efficient path between two points, avoiding obstacles along the way. They are used to make AIs navigate around game levels, although not exclusively: GPS services also use these algorithms to find efficient routes to your destination.

Godot provides the most widely used pathfinding algorithm in games and many other domains: AStar. It's a flexible and efficient algorithm that's excellent at finding the optimal path between two points.

The engine both provides it as a class you can use to build and traverse your maps manually and uses it as part of its navigation system, which finds efficient geometric paths on navigation meshes.

Pathfinding uses in games

In games, we use pathfinding algorithms to make AIs navigate around complex game worlds. For example:

Pathfinding tools in Godot

As mentioned above, Godot uses the AStar algorithm for pathfinding. The engine provides two classes to use it directly:

The engine also provides a more advanced pathfinding system called "navigation" that uses AStar internally:

These nodes allow AI-controlled entities called "agents" to find the shortest path between two points in the navigation regions. They can also avoid obstacles and other agents almost automatically. It's a powerful system with many features and settings.

Become an Indie Gamedev with GDQuest!

Don't stop here. Step-by-step tutorials are fun but they only take you so far.

Try one of our proven study programs to become an independent Gamedev truly capable of realizing the games you’ve always wanted to make.

Nathan

Founder and teacher at GDQuest
  • Starter Kit
  • Learn Gamedev from Zero
Check out GDSchool

You're welcome in our little community

Get help from peers and pros on GDQuest's Discord server!

20,000 membersJoin Server

Contribute to GDQuest's Free Library

There are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!