O'Reilly logo

Unity 4 Game Development HOTSHOT by Jate Wittayabundit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the enemy movement with the AI script

In the previous section, we have the waypoint set up for our enemy to move, but we don't have the enemy yet. In this section, we will create the script to control it by using a concept that was used in Project 5, Build a Rocket Launcher!. This AI script will inherit from CharacterClass that comes with the package.

Note

If we open CharacterClass, which is located at Chapter6 | Scenes | C# | Actor (for C# users) or Chapter6 | Scenes | JavaScript | Actor (for JavaScript users), we will see that there is a class that contains the methods and parameters that we have used in Project 5, Build a Rocket Launcher!.

Prepare for lift off

We will begin by adding the AI character to the Hierarchy view. Let's go to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required