Unity 5: 2D Pathfinding

0
Join & Subscribe
LinkedIn Learning
Free Trial Available
English
Certificate Available
Less than 1 hour of material
selfpaced

Overview

Learn how to move characters and objects from point A to B with this introduction to pathfinding in Unity.

Learn how to move characters and objects from point A to B with this introduction to pathfinding in Unity 5. This training focuses on pathfinding in the 2D world: programming simple ways to connect different locations in 2D games. Jesse Freeman starts by explaining the data structures (graphs and nodes) and the A* pathfinding algorithm: the technology that makes traversal of 2D games possible. Then he shows you how to connect paths in a 2D map, and find the fastest path between two points. You'll also build a simple demo map to illustrate and test the pathfinding logic.

Syllabus

Introduction
  • Welcome
  • Exercise files
1. Pathfinding Introduction
  • What is A*?
  • Setting up the project
2. The Node Class
  • What is a node?
  • Adding the node property
3. The Graph Class
  • What is a graph?
  • Storing the node
  • Indexing the nodes
  • Testing for neighbors
4. The Search Class
  • Building the Search class
  • Starting the search
  • The Step method
  • Traversing the nodes
  • Continuing the search
  • Searching adjacent nodes
  • Getting the node index
5. Testing the Search
  • Building a test map
  • Running the search
  • Creating a grid in Unity IU
  • Changing colors on the grid
  • Showing the path
Conclusion
  • Next steps

Taught by

Jesse Freeman