Reader small image

You're reading from  Unity Certified Programmer Exam Guide - Second Edition

Product typeBook
Published inMay 2022
Reading LevelIntermediate
PublisherPackt
ISBN-139781803246215
Edition2nd Edition
Languages
Right arrow
Author (1)
Philip Walker
Philip Walker
author image
Philip Walker

Philip Walker originally started as a 3D game artist, but then decided he wanted to combine his current skills with coding so that he could see through the majority of his games' and apps' development himself. Philip has worked in various different industries as an artist and as a Unity developer using various types of technology and techniques.
Read more about Philip Walker

Right arrow

Developing AI with NavMesh

In this section, we are going to introduce a new enemy that will attempt to flee with frenzy-type behavior from our player's ship. This enemy's behavior will be implemented with the use of Unity's built-in NavMesh functionality.

As you can imagine, this built-in feature from Unity can answer a lot of problems with regard to games with NPCs, similar to ones in the Metal Gear Solid game, where the player has to sneak around and not get detected by the enemy soldiers.

NavMesh gives the enemy soldiers a path to walk around, and then if they see the player, their behavior changes from Patrolling to Attack.

So, with our game, we are going to implement NavMesh but make it so that our enemies react differently to how they would in Metal Gear Solid. We will add multiple flee enemies in clusters to our third-level scene. This chaotic, distracting behavior will make the final level more challenging for our players.

The following screenshot...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Unity Certified Programmer Exam Guide - Second Edition
Published in: May 2022Publisher: PacktISBN-13: 9781803246215

Author (1)

author image
Philip Walker

Philip Walker originally started as a 3D game artist, but then decided he wanted to combine his current skills with coding so that he could see through the majority of his games' and apps' development himself. Philip has worked in various different industries as an artist and as a Unity developer using various types of technology and techniques.
Read more about Philip Walker