Chapter 9: Continuing with Intelligent Enemies

In the previous chapter, we imported an enemy object (a fearsome chick) and created a first-person controller for the player and the environment that both the player and enemy will traverse. In this chapter, we'll build on that foundation by focusing on the theory and implementation of creating an intelligent enemy. We'll imbue our enemy chick with the ability to have multiple different behaviors and to swap between those behaviors depending on the state of the world.

In this chapter, we will discuss the following:

  • How to enable the chick to see the player by using a line of sight and field of view
  • How to code a Finite State Machine (FSM): This will become the brain of the chick—ensuring that behaviors ...

Get Unity 2020 By Example - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.