Book Image

Mastering Unity Scripting

By : Alan Thorn
Book Image

Mastering Unity Scripting

By: Alan Thorn

Overview of this book

Table of Contents (17 chapters)
Mastering Unity Scripting
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Summary


The complete AI project created in this chapter can be found in the book's companion files (code bundle) in the ai folder of this chapter. I recommend that you open it and then test it out. Using the first-person controller, the player can navigate the level, avoid enemies, and also attack when enemies are in range using the Space bar, as shown here:

Testing the AI_Enemy class

There are, nonetheless, many ways in which the project can be improved further, for example, by adding multiple enemy types as well as varied strategies for each type, from taking cover to playing dead, and so on. However, nonetheless, we've come a long way and have developed Artificial Intelligence that relies on both a C# FSM as well as on a Mecanim FSM for animation playback.

In the next chapter, we'll leap out of the world of AI and into the world of editor customization to make game development smoother!