Reader small image

You're reading from  Hands-On Unity 2021 Game Development - Second Edition

Product typeBook
Published inAug 2021
Reading LevelBeginner
PublisherPackt
ISBN-139781801071482
Edition2nd Edition
Languages
Tools
Right arrow
Author (1)
Nicolas Alejandro Borromeo
Nicolas Alejandro Borromeo
author image
Nicolas Alejandro Borromeo

Nicolas is a Game Developer currently working as a Senior Software Development Consultant for Unity in London. He is a Unity Certified Instructor teaching Unity clients all around the globe. He started using Unity in 2008 and teaching it in 2012 in several Universities and Education Institutes.
Read more about Nicolas Alejandro Borromeo

Right arrow

Executing FSM actions

Now, we need to do the last step—make the FSM do something interesting. Here, we can do a lot of things, such as shoot the base or the Player and move the Enemy toward its target (the Player or the base). We will be handling movement with a Unity Pathfinding system called NavMesh, a tool that allows our AI to calculate and traverse paths between two points while avoiding obstacles, which needs some preparation to work properly.

In this section, we will examine the following FSM action concepts:

  • Calculating our scene's Pathfinding
  • Using Pathfinding
  • Adding the final details

Let's start by preparing our scene for movement with Pathfinding.

Calculating our scene's Pathfinding

Pathfinding algorithms rely on simplified versions of the scene. Analyzing the full geometry of a complex scene is almost impossible to do in real time. There are several ways to represent Pathfinding information that's been extracted...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Hands-On Unity 2021 Game Development - Second Edition
Published in: Aug 2021Publisher: PacktISBN-13: 9781801071482

Author (1)

author image
Nicolas Alejandro Borromeo

Nicolas is a Game Developer currently working as a Senior Software Development Consultant for Unity in London. He is a Unity Certified Instructor teaching Unity clients all around the globe. He started using Unity in 2008 and teaching it in 2012 in several Universities and Education Institutes.
Read more about Nicolas Alejandro Borromeo